So I have been exploring the Controller as syntax in AngularJS, and I want to know how to deal with directives and $scope, specifically inheritance of the controllers $scope or properties from a child directive.
I am using Typescript, so given this controller:
export class DefaultController implements IDefaultController {
customer: Models.ICustomer;
static $inject = ['$scope', 'config', 'customerDataService'];
constructor(private $scope: ng.IScope, private config: ApplicationConfig, private customerDataService: Services.ICustomerDataService) {
}
getCustomerById(id: number): void {
console.log(this.config.version);
this.customerDataService.getCustomer(id).then((customer) => {
this.customer = angular.extend(new Models.Customer(), customer);
});
}
}
How would I go about passing the customer down to a directive which would typically inherit the $scope of the parent controller.