In index.html, I am doing something like this:
<div ng-controller="MyController">
<div ng-model="pk" ng-init="pk='2'"></div>
</div>
Anyway, in my angular file, I am doing something like this:
.controller('MyController', [
'$scope', function($scope) {
alert('Sup ' + $scope.pk);
}
])
So lets say the pk for a URL is 2, I expect to see something like this:
Sup 2
However, my output is this :
Sup undefined
What am I doing wrong? Thanks!