0
この指令から私のサービスを呼び出すことはできません。私はwizard.jsでテンプレートを使用してウィザードのモーダルフォームを作成します。私はそれが角度2の問題btwかどうか分からない。ここで角度2の指令からサービスを呼び出すにはどうすればいいですか
は私のディレクティブです:
import {Directive,Input, EventEmitter, ElementRef, Output} from '@angular/core';
import {Injectable,Inject} from '@angular/core';
import {Service} from '../../../service/service';
@Directive ({
selector: '[bootstrap-application-wizard]',
providers:[DashboardService]
})
export class BootstrapApplicationWizard {
$el: any;
constructor(
private _service:Service){}
function render(){
wizard.on('submit', function(wizard): void {
this.submit = {'data1': 'John','data2': 'Doe'};
this._service.postData('data',this.submit).subscribe(x=>{
console.log('ok');
});
}
ngOnInit(){
this.render();
}
}
任意のアイデア?