-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@angular/cli] input decorator is removed when using the AoT build #36
Comments
Great idea! I'm facing the same problem on my project. However I gave your Idea a try.
I don't know how to get rid of this. I tried to export and wrap the function call, without any success. |
I really want to use |
another approach is to pass the inputs through state config: {
name: 'app',
component: App,
resolve: [
{
- token: 'app',
+ input: 'app',
deps: ...
},
],
}, |
That would not allow resolves declared on a parent state to be bound to a (routed) child component. It would have to be mapped on the view level. We already have the {
name: 'app',
component: App,
+ bindings: { app: 'app' },
resolve: [
{
token: 'app',
deps: ...
},
],
}, |
|
I'd like to point out that in @Component({
})
export class MyComponent {
constructor(@Inject('myResolve') public resolveData: any) {
}
}
@Component({
})
export class MyComponent2 {
public myResolve: any;
constructor(transition: Transition) {
this.myResolve = transition.injector().get('myResolve');
}
} |
since UIRouterModule.forRoot({ autoBindings: true }) |
I've been considering a similar thing, but how can you tell if a newly constructed component has a property or not?
|
it seems not possible :( |
@aitboudad For now I'm going to use your original idea of a Decorator like I don't like not using |
It should be solved soon see angular/angular@bd64ab5 |
@aitboudad that's very promising! |
I am going to remove the |
…n AoT When angular started stripping reflect metadata for AoT, it broke our ability to introspect a component to determine what inputs it had. In this commit angular/angular@bd64ab5 the inputs/outputs are added to the component factory, and we now have a public API to introspect component inputs. Closes #94 Closes #89 Closes #36
The resolve data doesn't supplies component inputs anymore in AoT build since the last version of
@angular/cli
as it remove all angular decorators in order to have less bundle size.I propose to introduce custom decorator for resolve data:
The text was updated successfully, but these errors were encountered: