AngularJS绑定变量到Angular 4之间的交互

时间:2019-05-20 11:39:09

标签: angular

 bindings: {
    //Inputs
    selectedService: "=",
    serviceInfo: "<",
    forms: "=",
    jobInfo: "<",
  }

  //angular js code to be used in angular 4
  bindings: {
    //Inputs
    selectedService: "=",
    serviceInfo: "<",
    forms: "=",
    jobInfo: "<",
  }
  
  
  //accessing as direcive in angular 4
  export class ServiceDetailDirective extends UpgradeComponent {

    constructor(elementRef: ElementRef, _injector: Injector) {
        const rootScope = _injector.get('$rootScope');
        const scope = rootScope.$new();
        const injector = Injector.create([
            {
                provide: '$scope',
                useValue: scope
            }
        ], _injector);
        super('agServiceDetail', elementRef, injector);
    }
}

//how i can access the "selectedService" in my angular 4 component

0 个答案:

没有答案