Within my cshtml file, I am working with a boolean variable. However, when attempting to pass this variable to my Angular directive, it is being received as "False" rather than "false". Even hardcoding it to be "false" in lowercase does not solve the issue.
This is how my cshtml file looks:
@{
var myVar = false;
}
<some-directive test="@myVar"></some-directive>
The Angular directive I am using for testing purposes has the following structure:
angular.module('someApp')
.directive('someDirective', function () {
return {
restrict: 'E',
scope: {
test: '@'
},
link: function ($scope, element, attrs) {
console.log($scope.test) // False
console.log(!$scope.test) // false
console.log(!!$scope.test) // true
}
}
});