fruitstand
Version:
28 lines • 1.02 kB
HTML
<html ng-app="myApp">
<head>
<title>AngularJS Expressions</title>
<style>
a{color: blue; text-decoration: underline; cursor: pointer}
</style>
</head>
<body>
<div ng-controller="myController">
Directly accessing variables in the scope:<br>
{{speed}} {{vehicle}}<hr>
Adding variables in the scope:<br>
{{speed + ' ' + vehicle}}<hr>
Calling function in the scope:<br>
{{lower(speed)}} {{upper('Jeep')}}<hr>
<a ng-click="setValues('Fast', newVehicle)">
Click to change to Fast {{newVehicle}}</a><hr>
<a ng-click="setValues(newSpeed, 'Rocket')">
Click to change to {{newSpeed}} Rocket</a><hr>
<a ng-click="vehicle='Car'">
Click to change the vehicle to a Car</a><hr>
<a ng-click="vehicle='Enhanced ' + vehicle">
Click to Enhance Vehicle</a><hr>
<script src="http://code.angularjs.org/1.3.0/angular.min.js"></script>
<script src="js/expressions_scope.js"></script>
</body>
</html>