|
frameborder="1" > |
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.street= "123 Quiet Ave";
$scope.city= "Green";
$scope.state= "AB";
$scope.zip= "54321";
$scope.fullAddress = function() {
return $scope.street + ", " +
$scope.city + ", " + $scope.state +
" " + $scope.zip;
}
});
|
frameborder="1" > |
<!DOCTYPE html> <br/><html> <br/><script src= "../js/angular.min.js"></script> <br/><body> <br/><p>Update text fields.</p> <br/><div ng-app="myApp" ng-controller="myCtrl"> <br/>Street: <input type="text" ng-model="street"><br> <br/>City: <input type="text" ng-model="city"><br> <br/>State: <input type="text" ng-model="state"><br> <br/>Zip: <input type="text" ng-model="zip"><br> <br/>Address: {{fullAddress()}} <br/></div> <br/><script> <br/>var app = angular.module('myApp', []); <br/>app.controller('myCtrl', function($scope) { <br/> $scope.street= "123 Quiet Ave"; <br/> $scope.city= "Green"; <br/> $scope.state= "AB"; <br/> $scope.zip= "54321"; <br/> $scope.fullAddress = function() { <br/> return $scope.street + ", " + <br/> $scope.city + ", " + $scope.state + <br/> " " + $scope.zip; <br/> } <br/>}); <br/></script> <br/></body></html> <br/>
<br/>var app = angular.module('myApp', []); <br/>app.controller('myCtrl', function($scope) { <br/> $scope.street= "123 Quiet Ave"; <br/> $scope.city= "Green"; <br/> $scope.state= "AB"; <br/> $scope.zip= "54321"; <br/> $scope.fullAddress = function() { <br/> return $scope.street + ", " + <br/> $scope.city + ", " + $scope.state + <br/> " " + $scope.zip; <br/> } <br/>});
<!DOCTYPE html> <br/><html> <br/><script src= "../js/angular.min.js"></script> <br/><script src= "../js/addressController.js"></script> <br/><body> <br/><p>Update text fields.</p> <br/><div ng-app="myApp" ng-controller="myCtrl"> <br/>Street: <input type="text" ng-model="street"><br> <br/>City: <input type="text" ng-model="city"><br> <br/>State: <input type="text" ng-model="state"><br> <br/>Zip: <input type="text" ng-model="zip"><br> <br/>Address: {{fullAddress()}} <br/></div> <br/></body></html> <br/> |
frameborder="1" > |