undefined
. If I grab the bundle and dump it on a page directly.dist/bundle/library-name.js
, has this line:(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('lodash')) :
(global = global || self, global['library-name'] = factory(global._));
}(this, function (_) { 'use strict';
global._
? Again, this is a dependency
, not a peerDependency
- wasn't the whole idea of dependencies that they're bundled with the library?
Hi guys, how you doing???
I need to ask a question regarding a possible project that I will be doing!
I need to write a questionnaire with conditions
For example
Gender -> Male -> Do you have a girlfriend?
Gender -> Female -> Do you have a boyfriend?
What could be the best way to do that???
´strictMetadataEmit´ is a flag for libraries, which shouldn't have any lazy loaded modules at all.
https://github.com/angular/angular/issues/31893#issuecomment-516615243
Can anyone elaborate why libraries shouldn't have lazy loaded modules? We're building an application platform and were planning to split features into various npm packages in a private npm registry for our inhouse devs and partners to install into their concrete project application as needed. We were hoping they could just import @company/feature-module
into their angular app and have everything wired up automatically, including the (lazy-loaded) routing.
nextQuestion() {
let currentQuestion = `Q${this.questionCounter}`;
this.listOfQuestions.currentQuestion[0].status
console.log(currentQuestion);
this.questionCounter++;
let nextQuestion = `Q${this.questionCounter}`;
// console.log();
}
It is possible to use currentQuestion to call a specific question???
Am I the only one to experience very frequent false aot re-build errors looking like below? They happen to point to very random LESS-files, which usually, as in this case were not modified at all, or even those components any way related to them were not modified.
These never occur on the first clean build, but only when using ng serve --aot
and making some modifications to the code. Also no matter what modifications you do, those false errors never go away until you kill ng serve and start another one. Pretty frustrating. I'm wondering if this has something to do with code maps, which are for us pretty useless regarding LESS files anyway.
ERROR in ./src/app/shared/views/cleaningMode/cleaningMode.less.shim.ngstyle.js
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: ENOENT: no such file or directory, open 'C:\PATH\TO\src\app\shared\views\cleaningMode\cleaningMode.less.shim.ngstyle.js'
at Object.openSync (fs.js:447:3)
at Object.readFileSync (fs.js:349:35)
at Storage.provideSync (C:\PATH\TO\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:98:13)
at CachedInputFileSystem.readFileSync (C:\PATH\TO\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:259:32)
at Observable._subscribe (C:\PATH\TO\node_modules\@ngtools\webpack\src\webpack-input-host.js:35:51)
at Observable._trySubscribe (C:\PATH\TO\node_modules\@ngtools\webpack\node_modules\rxjs\internal\Observable.js:44:25)
at Observable.subscribe (C:\PATH\TO\node_modules\@ngtools\webpack\node_modules\rxjs\internal\Observable.js:30:22)
at SyncDelegateHost._doSyncCall (C:\PATH\TO\node_modules\@angular-devkit\core\src\virtual-fs\host\sync.js:22:20)
at SyncDelegateHost.read (C:\PATH\TO\node_modules\@angular-devkit\core\src\virtual-fs\host\sync.js:49:21)
at WebpackCompilerHost.readFileBuffer (C:\PATH\TO\node_modules\@ngtools\webpack\src\compiler_host.js:147:44)
at VirtualFileSystemDecorator.readFile (C:\PATH\TO\node_modules\@ngtools\webpack\src\virtual_file_system_decorator.js:42:54)
at processResource (C:\PATH\TO\node_modules\loader-runner\lib\LoaderRunner.js:202:11)
at iteratePitchingLoaders (C:\PATH\TO\node_modules\loader-runner\lib\LoaderRunner.js:158:10)
at iteratePitchingLoaders (C:\PATH\TO\node_modules\loader-runner\lib\LoaderRunner.js:165:10)
at C:\PATH\TO\node_modules\loader-runner\lib\LoaderRunner.js:176:18
at loadLoader (C:\PATH\TO\node_modules\loader-runner\lib\loadLoader.js:47:3)
Hi all! I have an Angular Elements
question for someone. In my component, i’m trying to simply access the variable passed into my angular element web component. The rendering of the tag seems to be fine, but the data I’m trying to pass doesn’t appear to enter my component. I have my component:
<my-component count=“0”></my-component>
inside of my component .ts file:
@Input() count: number;
my actual component renders property, but this.count
is undefined. After some searching I found: https://blog.bitsrc.io/using-angular-elements-why-and-how-part-1-35f7fd4f0457 which seems like what I’m doing is correct but i’m obviously doing something wrong because I’m getting undefined. Anyone have any experience with this?
@Splaktar yeah, you need to include only the files that are needed in the compilation.
Using the below tsconfig should solve the issue.
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}
PS: At the moment, I am working on a migration for this
Generating ES5 bundles for differential loading...
An unhandled exception occurred: cancel after 1 retries!
See "/tmp/ng-8Tr7C1/angular-errors.log" for further details.
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! frontend-mallabee@2.0.1 build-dev: `ng build --configuration dev`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the frontend-mallabee@2.0.1 build-dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/circleci/.npm/_logs/2019-08-31T09_20_07_881Z-debug.log
Exited with code 1
public_api.ts