i am a newbie of AngularJS don't know what i am doing wrong here is my code. Basically i am trying to get attribute value of post-id from my index.html and print it in console from my controller.
In my index.html:
<post-creator post-id="5" category="1"></post-creator>
<script src="components/post-creator/post-creator.component.js"></script>
post-creator.component.js:
function controller($http) {
var model = this;
model.$onInit = function () {
console.log("id again:" + model.postId);
}
module.component("postCreator", {
templateUrl: "components/post-creator/post-creator.template.html",
bindings: {
value: "<"
},
controllerAs: "model",
controller: ["$http", controller]
});
bindingscontainpostIdinstead ofvalue?