I have a html page that needs to render dynamic content through AngularJS. I am loading the html page using requireJS. I have included angularJS in my script tag, but unable to create the controller. I can create an angular module but cannot access the controller function below
var model = {
items: [{ id: "id1", comment: "comment1" },
{ id: "id2", comment: "comment2" },
{ id: "id3", comment: "comment3" },
{ id: "id4", comment: "comment4" }]
};
var kmapp = angular.module("kmapp", []);
kmapp.controller('FieldCodesCtrl', ['$scope', function($scope) {
alert("in con");
$scope.greeting = 'Hiiiii!';
alert($scope.greeting);
}])
I cannot read the two alerts inside my controller function.
I am very new to AngularJS. Can someone please help out?
requirejs? Can you provide proof of concept on Github?