-binding part
properties and methods
both view and controller
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body ng-app="myApp">
<p>The rootScope's favorite color:</p>
<h1>{{color}}</h1>
<script>
var app = angular.module('myApp',...
Showing posts with label AngularJS. Show all posts
Showing posts with label AngularJS. Show all posts
Friday, August 26, 2016
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script>
angular.module('test', []).controller('menu', function($scope) {
$scope.names = [
{furit:'Orange',vegtable:'Drumstick'},
{furit:'Apple',vegtable:'Ladyfinger'},
...
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<div ng-app="test" ng-controller="myC">
Name: <input ng-model="firstname">
<h1>{{firstname}}</h1>
<h1>{{lastname}}</h1>
</div>
<script>
var...
Tuesday, August 9, 2016
Name:<input id="txtname" type="text"/>
Welcome!
<script>
var txtipt = document.getElementById('txtname');
txtipt.addEventListener('keyup', function(){
var text = txtipt.value;
...
Wednesday, July 20, 2016
Objects in angular js
Example:
<html >
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-init="emp={id:'1',name:'peak'}">
<p>The Emp Id is {{ emp.id }}</p>
</div>
</...