Showing posts with label angularjs tutorials. Show all posts
Showing posts with label angularjs tutorials. Show all posts

How to use ng-paste and ng-cut?

- ng-cut is specify custom behavior on cut event.

How to apply ng-cut?

 <input ng-cut="cut=true" ng-init="cut=false; value='please cut me'" ng-model="value">  
     You just cut it: {{cut}}  

- ng-paste is specify custom behavior on paste event.

How to apply ng-paste?

  <input ng-paste="paste=true" ng-init="paste=false" placeholder='please paste here'>  
     pasted: {{paste}}  

Full code for this example as below:



Tutorial 33 - angularjs works with wcf

Angularjs works with wcf

on-going


Tutorial 31 – service $http in angularjs

Service $http in angularjs

 In AngularJS the $http is a core service for reading data from web servers.
Expression: $http.get(url) 

Example:
we have a url as http://www.youdomain.com/data/getStudent and this url return following data



Tutorial 30 - AngularJS works via Bootstrap example

AngularJS works via Bootstrap example

This example will help you know about using Bootstrap in AngularJS page. Ok the same with HTML page, to use Bootstrap you must refer to css library of Bootstrap

Of course you must refer AngularJS also:
 <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">  

 <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>  

Following directives will be used in this example.
  • ng-controller
  • ng-submit
  • ng-pattern
  • ng-model
  • ng-trim
  • ng-minlength
  • ng-maxlength
  • required
and use class="col-md-4" in Bootstrap



Tutorial 29 - AngularJS form example

AngularJS form example

form is a directive in module ng of angularjs to for detail about definition of please refer direct AngularJs doc for this to know more. In this post i just want to make a example to help you learn easy.

This sample will guild you know how to build a form in angularjs. Following directives will be used in this sample.
  • ng-controller
  • ng-submit
  • ng-pattern
  • ng-model
  • ng-trim
  • ng-minlength
  • ng-maxlength
  • required
Please following this sample code and change something on it to known more.



Tutorial 28 - Angularjs listbox example

Angularjs listbox example

This sample will help you know about using combobox via AngularJS. Ok we will answer two questions blow:

How to binding data to listbox?
How to get seclected value of listbox?


Tutorial 27 - Angularjs combobox example

Angularjs combobox example

This sample will help you know about using combobox via AngularJS. Ok we will answer two questions blow:

How to binding data to combobox?
How to get seclected value of combobox?



Tutorial 26 - AngularJS table example

AngularJS table example

This tutorial guides you how to apply angularjs to <table>, following directive will be used in this sample:
  • ng-init
  • ng-repeat
  • ng-class-odd
I hope that after run this sample code you will can anwser the question “Why choose AngularJS?



Tutorial 25 - Validation in angularjs.

Validation in angularjs.
AngularJS providers more attributes to help programer can validate form and controls in form easy. A form is valid when all of control in it to be valid.
The first we need to know about below property of angularjs:

$dirty: It means that user has interacted with the field.
$valid: It means that the field content is valid.
$invalid:  It means that the field content is invalid.
$pristine:  It means that user has not interacted with the field yet.

Ok follow this sample.



Tutorial 24 - AngularJS Global API

Hơ to use AngularJS Global API

 This tutorial provides samples to help you know how to use following common API: angular.isString(),angular.isNumber(),angular.lowercase() and angular.uppercase().

•    How to use angular.isString().
This sample will help you know about using angular.isString() in AngularJS



Tutorial 23 - AngularJS format and filtering?

AngularJS format and filtering

The sample show how to filter data in angularjs, filtering with currency format example.



Tutorial 22 - Directive ng-disabled

How to use ng-disabled in angularjs?

This sample will help you know about using ng-disabled in AngularJS




Tutorial 21 - event ng-click in angularjs?

How to use ng-click in angularjs?

This sample will help you know about using ng-click in AngularJS



Tutorial 20 – how to use ng-class-odd in angularjs

How to use ng-class-odd in angularjs?

This sample will help you know about using ng-class-odd in AngularJS.



Tutorial 19 – how to use ng-class in angularjs

How to use ng-class in angularjs?

This sample will help you know about using ng-class in AngularJS. You will like this directive after you run ng-class example as below.



Tutorial 9 – how to use input via a date type in AngularJS

Tutorial 9 – how to use input via a date type in AngularJS
This sample will help you know easy about using input via date type.



Tutorial 5 - ng-model in AngularJS

Tutorial 5 - ng-model in AngularJS
Ng-model is directive in AngularJS, used to link data between server and client throught controller.
How to define an ng-model in HTML?
You can add ng-model directive to a HTML tag
Example:
<input ng-model="val" class="my-input" />

Full HTML sample for ng-model.



Tutorial 4 - rootScope in controller

Tutorial 4 - $rootScope in controller

$rootScope is parent of a $scope, with $rootScope we can access data from a Controller to  other Controllers.




Tutorial 3 - $sope in controller

Tutorial 3 - $sope in controller
$scope is an object data storage bridge, or we can understand it as a data warehouse which other objects as Controller, Service will use and exchange of information through it.

How to define a $scope in Javascript?



Tutorial 2 - ng-controller in AngularJS

In AngularJS, an applications are controlled by controllers.
The ng-controller directive defines the application controller.
One ng-app have one more ng-controller

How to define a controller Javascript?



Popular Posts