angular-decorators
angular-decorators copied to clipboard
properties on component not accessible inside component
Suppose
@Component({
selector: 'time-table',
controllerAs: 'TimeTableCtrl',
properties: [
'@minHour',
'@maxHour',
'=myEvents'
]
})
@View({template: require('./timetable.html')})
@Inject('$log')
export class TimeTableComponent {
How can I access the myEvents in the TimeTableComponent? I cannot seem to reference them inside the component itself. Using '{{TimeTableCtrl.myEvents}}' in HTML works!
Ok, I solved it myself. Needed to add a @Require tag, like so
@Component({
selector: 'time-table',
properties: [
'@minHour',
'@maxHour',
'=myEvents'
]
})
@View({template: require('./timetable.html')})
@Inject('$log')
@Require('^parent')
export class TimeTableComponent {