I'm currently getting to grips with angular and I'm a complete new guy to it, I've put together a jsfiddle for the issue.
But in short I'm not sure why my function attached to the angular scope is called twice.
Script
var registrationModule = angular.module("registrationModule", []);
registrationModule.controller("NavigationController", function ($scope) {
$scope.menuItems = [{ text: 'Home'}];
alert("hi");
$scope.getClass = function (path) {
alert("getClass");
return "frank";
};
});
HTML
<body ng-app="registrationModule">
<div class="collapse navbar-collapse navbar-responsive-collapse">
<ul class="nav navbar-nav navbar-right" ng-controller="NavigationController">
hi {{ getClass(); }} butcher
</ul>
</div>
</body>
Any tips?