Comments (19)
https://github.com/cankayacan/ng5-dynamic-component-test
Getting this error:
Error: Unexpected value '[object Object]' imported by the module 'AppModule'. Please add a @NgModule annotation.
from ng-dynamic-component.
Yes, I will prepare an upgraded version very soon.
from ng-dynamic-component.
Hi!
There is another bug with official release of Angular 5.
ERROR Error: Uncaught (in promise): Error: Unexpected value '[object Object]' imported by the module 'ImmeubleModule'. Please add a @NgModule annotation.
Indeed in dynamic.module.d.ts:
import { ComponentInjector } from './component-injector'; import { ModuleWithProviders, Type } from '@angular/core'; export declare class DynamicModule { static withComponents(components: Type<any>[], componentInjector?: Type<ComponentInjector>): ModuleWithProviders; }
No @NgModule annotation.
Many thanks,
from ng-dynamic-component.
Hey, you will not see any annotations in the *.d.ts
files - those are just for typescript compiler not runtime.
I guess this problem happens because I build it with RC5 and you are trying with actual release v5.
I will publish stable version with v5 so you can try it
from ng-dynamic-component.
Hello,
I still get the error message ERROR Error: Unexpected value '[object Object]' imported by the module 'MonthlyBonusModule'. Please add a @NgModule annotation.
Using ng5 - dynamic 2.0.1 & cli 1.5
from ng-dynamic-component.
very simple, use [email protected] not 2.5.3
The problem is angular not notifying about it
from ng-dynamic-component.
I don't know...
They know about it so work is on way...
The issues are with tsickle mostly, not emitting the decorators... other then that you can AOT compile an app and it will work...
Since it's one shot compile the data is kept
from ng-dynamic-component.
Hey there!
Just published new next version of lib under next
tag in NPM so you can go ahead and try it out:
$ npm install ng-dynamic-component@next
All changes are currently in separate next
branch - until Angular 5 will be officially released.
from ng-dynamic-component.
Hmm... I will try on a sample app later.
Thanks for reporting, reopening issue.
from ng-dynamic-component.
Yes, same for me. Good luck!
from ng-dynamic-component.
I ran into the same issue today using CLI 1.5, NG 2.1 and ng-dynamic-component 2.0.1, like all the others.
I compared the generated JS bundle for ng-dynamic-component and another open source library which is not triggering exceptions just to find that the generated class does contain additional metadata.
TooltipModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule],
declarations: [TooltipDirective, TooltipContainerComponent],
exports: [TooltipDirective],
entryComponents: [TooltipContainerComponent]
},] },
];
This decorators
property is not present in case of generated DynamicModule
, so I bet that this is what's causing NG to error out. I'm not sure though why this happens.
from ng-dynamic-component.
@lukaszbachman thanks for pointing to this, I will check why they are not appearing
from ng-dynamic-component.
Just confirmed that NGC does not generate metadata anymore for the project...
I guess it's because Angular v5 by default strips any angular specific decorators to optimize bundle.
Need to look for any config flags how to turn it off...
from ng-dynamic-component.
So I found this property called generateCodeForLibraries
for angularCompilerOptions
in tsconfig.json and I tried to set it to true and still did not get any decorators emitted...
Really weird.
Anyone has any idea what might be the issue?
from ng-dynamic-component.
@gund, this seems to be related angular/angular#20219
from ng-dynamic-component.
@elclanrs looks interesting but they are talking about code-gen of ngfactory
s and here we are not generating them.
In our case there are not a single decorator being emitted by the NGC.
I just tried to use TSC with the same config and it did output all decorators - so it's purely NGCs issue now.
Trying to build a reproduction app now...
from ng-dynamic-component.
2.5.3 support can be tracked here angular/angular#20175
from ng-dynamic-component.
Hey @shlomiassaf thanks for the info. Just tried with TS v2.4 and it did work.
Angular team already knows about the problem with decorators in TS v2.5 or it makes sense to create a repro app and link to the issue?
from ng-dynamic-component.
You can try v2.0.2 - should be fixed
from ng-dynamic-component.
Related Issues (20)
- Is this project abandoned? HOT 3
- Question about dynamic templates HOT 2
- Support RxJS ^7.4.0 HOT 2
- Support for Angular 14 HOT 7
- Need add rxjs 7 support for version 9.x.x HOT 14
- Building app with angular 13 leads to compile error HOT 6
- Outputs initialized after inputs which leads to missed events triggered synchronously from constructors/setters HOT 2
- Cannot access 'IoService' before initialization HOT 8
- Backwards compatibility with Angular 13 in minor update v10.x.x is broken HOT 1
- [Question] How to call functions mentioned in dynamic components HOT 2
- Support for Angular 15 HOT 4
- Ability to provide ngModuleRef when creating component HOT 4
- [BUG] `IoEventContextToken` is not exported HOT 3
- Unknown input error after updating from no-barrels version [Bug] HOT 1
- Property 'withComponents' does not exist on type 'typeof DynamicModule'. HOT 1
- Support angular 14 HOT 1
- Component not support nested HOT 2
- [Bug] HOT 2
- Support for Angular 16 HOT 3
- Angular 17 support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-dynamic-component.