【发布时间】:2016-01-21 09:29:26
【问题描述】:
这是我的情况:
我有一个组件:
@Component({
selector: 'home',
templateUrl: './administration.html',
directives: [Directivetest]
})
export class Administration {
Hello : string;
constructor(private http: Http) {
}
ngOnInit() {
//init stuff here
}
callMe(value) {
alert("call you" + this.Hello );
}
}
还有我的模板:
<h3>Test Administration </h3>
<directivetest></directivetest>
这是我的指令:
@Component({
selector: 'directivetest',
templateUrl: './directivetest.html'
})
export class DirectiveTest{
klickme() {
//CALL A Administration Function (callMe(value)) or change the value????????????
}
}
有没有办法从我的“指令”组件中更改变量或调用函数,
【问题讨论】:
标签: javascript typescript angular