Last active
January 16, 2017 13:53
-
-
Save hpstuff/c5034a10cca989171c5d179ae8755e5c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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