Sandeep Kumar Patel's Blog, page 3
November 24, 2014
AngularJS ngNonBindable Directive Example

AngularJS provides ngNonBindable directive to create non bindable expression.In this demo,”We will see an example of non bindable AngularJS expression”.Below code used the ngNonBindable directive to unbind the expression.<!DOCTYPE html>
<html ng-app="myApp">...
Published on November 24, 2014 05:47
November 23, 2014
AngularJS ngClassEven NgClassOdd Example

AngularJS provides ngClass,ngClassEven and ngClassOdd directives for controlling applied class to an element.ngClassEven and ngClassOdd can be used in ngRepeat loop to style the alternate rows.In this...
Published on November 23, 2014 07:22
November 22, 2014
AngularJS uiGrid Module Example

Published on November 22, 2014 08:30
November 20, 2014
AngularJS ngSrcset directive Example

<html ng-app="myApp">
<head>
<script src="http://www.tutorialsavvy.com//ajax.go...
<meta charset="utf-8">
<title>AngularJS ngSrcset Example</title>
</head>
<body ng-controller="MyController">
<h3>ngSrcset directive Example</h3>
<img ng-srcset="{{myImageSize100}},{{myImageSize100}},{{myImageSize200}}"></img>
<script>
var myApp = angular.module("myApp", []);
myApp.controller("MyController", ["$scope", function($scope) {
$scope.myImageSize50 = "http://www.gravatar.com/avatar/c6e6c5... 100w";
$scope.myImageSize100 = "http://www.gravatar.com/avatar/c6e6c5... 300w";
$scope.myImageSize200 = "http://www.gravatar.com/avatar/c6e6c5... 700w";
}]);
</script>
</body>
</html>
The output of the above code is embedded in below JSBIN link.Just resize the window to check how ngSrcset changes the image URL and display different Gravatar image size.AngularJS ngSrcset Example
Published on November 20, 2014 09:18
November 17, 2014
AngularJS ngBind ngBindTemplate ngBindHtml directive Example

Below code shows the use of ngBind, ngBindTemplate and ngBindHtml with scope variable.<!DOCTYPE html>
<html ng-app="myApp">
<head>
<script src="http://www.tutorialsavvy.com//ajax.go...
<script src="http://www.tutorialsavvy.com//ajax.go...
<meta charset="utf-8">
<title>AngularJS ngBind ngBindHtml ngBindTemplate Example</title>
</head>
<body ng-controller="MyController">
<h3>ngBind directive Example</h3>
<h4 ng-bind="myName"></h4>
<h3>ngBindTemplate directive Example</h3>
<h4 ng-bind-template="{{myCountry}} {{myCity}}"></h4>
<h3>ngBindHtml directive Example</h3>
<h4 ng-bind-html="myBlog"></h4>
<script>
var myApp = angular.module("myApp", ['ngSanitize']);
myApp.controller("MyController", ["$scope", function($scope) {
$scope.myName = "Sandeep Kumar Patel";
$scope.myBlog = "Chek my Blog <a href='http://www.tutorialsavvy.com'>My Small Tutorial</a>";
$scope.myCity = "Bangalore";
$scope.myCountry = "India";
}]);
</script>
</body>
</html>
The output of the above code is embedded in below JSBIN link.AngularJS ngBind ngBindHtml ngBindTemplate Example
Published on November 17, 2014 07:40
November 16, 2014
AngularJS $interpolateProvider Example

<html ng-app="myApp">
<head>
<script src="http://www.tutorialsavvy.com//ajax.go...
<meta charset="utf-8">
<title>AngularJS $interpolateProvider Example</title>
</head>
<body ng-controller="MyController">
<h3>$interpolateProvider startSymbol() and endSymbol</h3>
<h4>[[myName]]</h4>
<script>
var myApp = angular.module("myApp", []);
myApp.config(function($interpolateProvider) {
$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');
});
myApp.controller("MyController", ["$scope", function($scope) {
$scope.myName = "Sandeep Kumar Patel";
}]);
</script>
</body>
</html>
The output of the above code has been embedded in below JSBIN link.AngularJS $interpolateProvider Example
Published on November 16, 2014 07:04
November 15, 2014
AngularJS ngList Built-In Directive Example

<html ng-app="myApp">
<head>
<script src="http://www.tutorialsavvy.com//ajax.go...
<meta charset="utf-8">...
Published on November 15, 2014 07:51
November 14, 2014
AngularJS Built-In Filter Example

<html ng-app="myApp">
<head>
<script src="http://www.tutorialsavvy.com//ajax.go......
Published on November 14, 2014 07:52
November 13, 2014
AngularJS $linky Filter Example

Published on November 13, 2014 08:13
November 12, 2014
Object create and defineProperties Method

thi...
Published on November 12, 2014 08:13