Angular Learning
What is SPA - Singel Page Applications
- There is no complete page re-load that is only required areas are updated instead of reloading the page each and every page at postbacks
- Speed up the page load and navigation for the users
- Similar to Desktop applications user experience
- It gives feeling like there is only one page. Ex : Gmail is developed using SPA
- I mean we need responsive web apps
- How to achieve SPA is that we need to use Javascript Frameworks such as AngularJS, KnockoutJS EmberJS, React etc
Why we need Angular
- I want Bi-directional dataBinding
- I want to keep HTML separate and Javascript code separate so that we can make use of code-reuse
How do I tell the browser that the page is AngularJS is that we need to add directive called "ng-app" to either html tag, Div tag or Body tag
What is Directives - It is a special kind of attributes [which has meaning described inside the angular js file referred] for an HTML element
Ex: ng-app , ng-init , ng-hide , ng-show,
ng-true-value and ng-false-value for checkboxes
ng-options for dropdown or list boxes
ng-repeat mostly for loop like
ng-bind - It binds expression value to the HTML element
ng-model - what ever data we type in input element like textbox, will be stored inside that ng-model assigned variable. It means two way data binding [ what ever we type in model will reflect in view]
Module [nothing but it is a logical unit] - It is like a namespace which contains set of classes
Controllers - it is Javascript function used to prepare data [Models] that can be rendered in HTML page [Views]
$Scope - it is an object where we can store Model and binds data between HTML pages View and controller
Comments
Post a Comment