- 1 <html>
- 2 <head>
- 3 <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
- 4 </head>
- 5 <body >
- 6 <div ng-app="" ng-controller="myCtrl">
- 7 <input type="text" ng-model="name"> </input>
- 8 <h3> {{name }} </h3>
- 9 <h1> We got {{mealDetails[favorite_meal]}} today at {{favorite_meal}} </h1>
- 10 <select ng-model="favorite_meal">
- 11 <option ng-repeat="c in meals"> {{c}} </option>
- 12 </select>
- 13
- 14 <script>
- 15 function myCtrl($scope){
- 16 $scope.meals = [ 'breakfast' , 'lunch' , 'dinner' ];
- 17 $scope.mealDetails = { breakfast: "eggs", lunch: 'pizza' , dinner: 'soup' } ;
- 18 }
- 19 </script>
- 20 </div>
- 21 </body>
- 22 </html>
SHARE
TWEET
Untitled
a guest
Dec 26th, 2014
142
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

