<!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.3/angular.min.js"></script> <script> var app = angular.module("myApp", []); app.controller("myCtrl", function($scope) { $scope.records = [ "Alfreds Futterkiste", "Berglunds snabbköp", "Centro comercial Moctezuma", "Ernst Handel" ] $scope.values = [ { myvalue: 1, mytext: "hello", myjob: "UI" }, { myvalue: 2, mytext: "hello friend", myjob: "UI Dev" } ] }) </script> </head> <body ng-app="myApp" ng-controller="myCtrl"> <div> <label>Name:</label> <h1 ng-repeat="x in records">{{x}}</h1> <p ng-repeat="y in values">{{y.mytext}}</p> <input type="text" ng-model="yourName" placeholder="Enter a name here"> <hr> <h1>Hello {{yourName}}!</h1> </div> </body> </html>
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more