叫funtion这是我的情况:变化而变化或从一个组件从其他组件
我有一个组件:
@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????????????
}
}
有没有办法改变的变量,或是从我的“指令”组件调用一个函数,
我想我误解了逻辑感谢您对我正道! – user3369579
是啊......这种方式只用于角度1中的控制器之间的通信。 – binariedMe
这意味着我可以随时将来自服务器的所有大数据导入到我的服务中,并从我的组件中获取我的Angular服务中的任何内容? – user3369579