title: get value of angular js expression in window.alert in angularJs
body: <p>Hi I am trying to alert the value of an expression in angularJs</p>
  
  <p>I am quite new to angular and am just trying to work out how grab the value of the expression in an alert or in the console.</p>
  
  <p>I am using AngularJs with json, below is my code</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
    &lt;script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"&gt;&lt;/script&gt;
    &lt;script src="app.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body ng-app='app'&gt;
    &lt;div ng-controller="ListCtrl"&gt;
      &lt;ul&gt;
        &lt;li ng-repeat="menu in menus" id="{{menu.id}}" class="{{menu.cssClass}}"&gt;
          &lt;a ng-href="{{menu.content}}" ng-click="doGreeting(greeting)"&gt;{{menu.description}}&lt;/a&gt;
          &lt;ul&gt;
            &lt;li ng-repeat="submenu in menu.menu" id="{{submenu.id}}" class="{{submenu.cssClass}}"&gt;
              &lt;a ng-href="{{submenu.content}}" ng-click="ShowAlert()"&gt;{{submenu.description}}&lt;/a&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>JAVASCRIPT</strong></p>
  
  <pre><code>var app = angular.module("app", []);
  
  app.controller("ListCtrl", ["$scope", "$http", "$window",
    function($scope, $http, $window) {
      $http.get('menu.json')
        .then(function(response) {
          $scope.menus = response.data.menus; // response data
          $scope.greeting = 'Hello, World!';
          $scope.ShowAlert = function () {
              $window.alert("{{menu.content}}");
          }
        });
    }
  ]);
  </code></pre>
  
  <p><strong>JSON</strong></p>
  
  <pre><code>{
     "menus":[
        {
           "id":"contact",
           "leaf":true,
           "description":"Contact Us",
           "link":"",
           "content":"contactUs.html",
           "cssClass":"static-content",
           "menu":null
        },
        {
           "id":"rules",
           "leaf":false,
           "description":"Sports Betting Rules",
           "link":"",
           "content":"",
           "cssClass":"",
           "menu":[
              {
                 "id":"types",
                 "leaf":true,
                 "description":"Wager Types",
                 "link":"",
                 "content":"wagerTypes.html",
                 "cssClass":"static-content wager-types",
                 "menu":null
              },
              {
                 "id":"odds",
                 "leaf":true,
                 "description":"Odds &amp; Lines",
                 "link":"",
                 "content":"oddsAndLines.html",
                 "cssClass":"static-content",
                 "menu":null
              },
              {
                 "id":"policies",
                 "leaf":true,
                 "description":"Rules &amp; Policies",
                 "link":"",
                 "content":"rulesAndPolicies.html",
                 "cssClass":"static-content rules-policies",
                 "menu":null
              },
              {
                 "id":"bonuses",
                 "leaf":true,
                 "description":"Sports Bonuses",
                 "link":"",
                 "content":"sportsBonuses.html",
                 "cssClass":"static-content",
                 "menu":null
              }
           ]
        },
        {
           "id":"conditions",
           "leaf":false,
           "description":"Terms &amp; Conditions",
           "link":"",
           "content":"",
           "cssClass":"",
           "menu":[
              {
                 "id":"termsOfService",
                 "leaf":true,
                 "description":"Terms of Service",
                 "link":"",
                 "content":"termsOfService.html",
                 "cssClass":"static-content",
                 "menu":null
              },
              {
                 "id":"privacy",
                 "leaf":true,
                 "description":"Privacy Policy",
                 "link":"",
                 "content":"privacy.html",
                 "cssClass":"static-content",
                 "menu":null
              }
           ]
        },
        {
           "id":"view",
           "leaf":true,
           "description":"View in: Mobile | Full Site",
           "link":"",
           "content":"view.html",
           "cssClass":"static-content",
           "menu":null
        }
     ]
  }
  </code></pre>