This is a snippet of my code:
Code written in C#:
public bool isAllowed { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
isAllowed = false;
}
Angular controller:
<script>
var myApp = angular.module('myApp', []);
myApp.value('allowed', <%= isAllowed %>);//myApp.value('allowed', False);
myApp.controller('TestController', ['$scope', function ($scope, allowed) {
$scope.result = allowed;
}]);
</script>
View:
<body data-ng-app="myApp">
<div data-ng-controller="TestController">{{result}}</div>
</body>
After implementing, I encountered:
Uncaught ReferenceError: False is not defined
and
myApp.value('allowed', False);
Can someone assist in passing a boolean value to $scope.result?