叫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