title: How can I pass a Razor boolean variable to an Angular directive?
body: <p>I have a boolean variable in my cshtml file. When I try to pass it to my Angular directive, it is received as "False" instead of "false". If I hardcode it to "false" (lower case), it does not work either.</p>
  
  <p>My cshtml file:</p>
  
  <pre><code>@{
      var myVar = false;
  }
  
  &lt;some-directive test="@myVar"&gt;&lt;/some-directive&gt;
  </code></pre>
  
  <p>My test directive is like this:</p>
  
  <pre><code>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
            }
        }
    });
  </code></pre>