Skip to content

Instantly share code, notes, and snippets.

@hpstuff
Last active January 16, 2017 13:53
Show Gist options
  • Save hpstuff/c5034a10cca989171c5d179ae8755e5c to your computer and use it in GitHub Desktop.
Save hpstuff/c5034a10cca989171c5d179ae8755e5c to your computer and use it in GitHub Desktop.
//parent
class ParentController {
constructor(private ServiceName: any, private ServiceName2: any) {}
}
//parent tempalte
<component title="Employee History" service="$ctrl.ServiceName">
<component title="Salary History" service="$ctrl.ServiceName2">
//component
class ComponentController {
private _service: any;
private set service(value: any) {
this._service = value;
this._service.find() //get data from promise;
}
private get service(): any {
return this._service;
}
costructor() {}
}
angular
.module('employees')
.component('component', {
template: require('./component.pug')(),
controller: ComponentController,
bindings: {
title: '@',
serivce: '='
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment