Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (21 sloc) 592 Bytes
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic Scope Example</title>
<script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script>
</head>
<body>
<div ng-app="demoApp" ng-controller="demoCtrl">
<input ng-model="word">
<h1>Hello, {{word}}!</h1>
</div>
<script>
var app = angular.module('demoApp', []);
app.controller('demoCtrl', function($scope) {
$scope.word = "word";
});
</script>
<p>If we change the word in the input field, the change will affect the model and the word property in the controller.</p>
</body>
</html>