Is there a way to overcome the issue of value assignment not binding data in this scenario? For example, using
this.arrayVal = someService.arrayVal
does not work as intended.
The objective is to simplify the assignment in both HTML and controller by using Ctrl.arrayVal
instead of Ctrl.someService.arrayval
Controller:
module Controllers {
export class SomeController {
arrayVal: Array<SomeModel>;
static $inject = ['someService'];
constructor(
private someService: SomeService
){
this.arrayVal = someService.arrayVal;
//It would be ideal to keep the assignment simple in HTML -> Ctrl.arrayVal vs Ctrl.someService.arrayval
}
}
}
Service:
class SomeService {
arrayVal = $http.get('http://Address');
}