I tried to add @Input, @Output Properties to a component:
@Component({selector: 'todo-cmp'})
class TodoCmp {
@Input() model;
@Output() complete = new EventEmitter(); // TypeScript supports initializing fields
onCompletedButton() {
this.complete.next(); // this fires an event
}
}
But i get the error:
app/app1.ts (13, 4): Cannot find name 'Input'.
I'm able to use them testing against the current master. Which version are you using?
Can you share the module imports that you're using to gain access to @Import and @Output?
I use angular Alpha 46 and cli 0.0.15
what modules do I have to import?
If you're using Angular Alpha 46, you should import the following for the code that you sent:
import {Input, Output, Component} from 'angular2/angular2';
If you update to the latest Alpha 48:
import {Component, Input, Output} from 'angular2/core';
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
If you're using Angular Alpha 46, you should import the following for the code that you sent:
If you update to the latest Alpha 48: