title: Passing information from Razor client (cshtml) to AngularJS
body: <p>I have the following razor file: </p>
  
  <pre><code>@{
      ViewBag.Title = "Blah";
      Layout = "~/Views/Shared/_Layout.cshtml";
      ViewBag.InitModule = "myFooModule";
  }
  
  @section Scripts{
      &lt;script src="~/Scripts/angular-route.js"&gt;&lt;/script&gt;
      &lt;script src="~/Scripts/angular-route.min.js"&gt;&lt;/script&gt;
      &lt;script src="~/js/recipes.js"&gt;&lt;/script&gt;
  }
  &lt;div data-ng-view
  </code></pre>
  
  <p>Here is my angularjs code:</p>
  
  <pre><code>var testModule = angular.module("myFooModule", ['ngRoute']);
  
  appetizerModule.config(["$routeProvider", function ($routeProvider) {
      $routeProvider.when("/", {
          controller: "myController",
          templateUrl: "/Templates/test.html"
      });
      $routeProvider.otherwise({ redirectTo: "/" });
  }]);
  </code></pre>
  
  <p>I would like to pass a variable with data like "myuserinfofromPage" from my razor page to my angularJs so that I can use that data ("myuserinfofromPage") to perform certain set of operations. I am struggling to get a clean way to pass data as I am new to AngularJS. What's the best way to pass simple data from Razor(cshtml) to my Angular code?</p>