absjabed

Where I want to use AngularJs

Mar 27th, 2018
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. @{
  3.  Layout = null;
  4. }
  5.  
  6. @Scripts.Render("~/bundles/angular")
  7.  
  8. <div ng-app="scopeExample">
  9.  
  10.     <div ng-controller="MyController">
  11.         Your name:
  12.         <input type="text" ng-model="username">
  13.         <button ng-click='sayHello()'>greet</button>
  14.         <hr>
  15.         {{greeting}}
  16.  
  17.         <h4>{{username}}</h4>
  18.     </div>
  19. </div>
  20. <script>
  21.         alert("sasa")
  22.  
  23.         angular.module('scopeExample', [])
  24.         .controller('MyController', function ($scope) {
  25.             $scope.username = 'World';
  26.  
  27.             $scope.sayHello = function () {
  28.                 $scope.greeting = 'Hello ' + $scope.username + '!';
  29.             };
  30.         });
  31.  
  32.  
  33.     </script>
Advertisement
Add Comment
Please, Sign In to add comment