I've got the following code, where I expect the content of the property variable
to be displayed in the page. I read a couple of posts and tried to find out what I'm doing wrong, but couldn't find the error. Here is the code:
namespace testWeb.about {
class AboutComponent implements ng.IComponentOptions {
templateUrl = "scripts/components/about/about.html";
controller = AboutController;
bindings: any;
constructor() {
this.bindings = {
awesomeThings : '<',
property : '<'
};
}
}
interface IAboutController {
awesomeThings: Array<string>;
property: string;
}
export class AboutController implements IAboutController, ng.IComponentController {
awesomeThings: Array<string>;
property: string;
constructor() {
this.awesomeThings = [
"one",
"two",
"three"
];
this.property = "123";
}
}
angular.module("test_web")
.component("about", new AboutComponent())
.config(($stateProvider) => {
"ngInject";
$stateProvider
.state("about", {
url: "/about",
template: `<about></about>`
});
});
}
Whether <span ng-repeat="dd in $ctrl.awesomeThings">{{dd}}</span>
nor <span class="as">{{$ctrl.property}}</span>
gets displayed.
<span ng-repeat="dd in $ctrl.awesomeThings">{{dd}}</span>
<span class="as">{{$ctrl.property}}</span>
<p>123</p>