While i came across AngularJS, I was fascinatred. When I had worked through the group of tutorials available on the AngularJS website, I was thrilled to get found this framework.
What exactly is AngularJS? AngularJS is the (relatively) new framework in the web development space.
Developed by Miško Hevery – both Search engines employees at that time – it really is entirely JavaScript and entirely client-side, so Angularjs will run as javascript, after all it is a javascript framework. It’s also small: compressed as well as minified it’s less than twenty nine kb. And it’s open source underneath the MIT license. You can even make use of the logo.
According to Wikipedia the goal of Angular is to increase browser-based applications with model-view-controller (MVC) architecture, and it really does just that, providing a binding/MVC platform.With a structure as basic as my data, a person bind data to your web page. The $scope service picks up changes to the model as well as modifies HTML expressions within the view by way of controllers. Doing work in the other direction, changes to the view outside the window are reflected in the product. This removes the need for most DOM manipulations a lot of us take for granted while using something like JQuery.
Angular runs no library dependencies, although it can be extended using the many modules that are available, not to mention you can build your own to suit your specific needs. Being genuine JavaScript, it also has the advantage of being server-agnostic.

Directives

Angular uses directives to connect its action into the web page. Directives, all prefaced along with ng-, are placed in code attributes.
Some common directives which come pre-built with Angular are generally:
ng-app: this is essentially the primary entry point of Angular on the page. It tells Angular where it gets to work. is all it takes to specify a page as an Angular app.
ng-bind: changes the text associated with an element to the value of a manifestation.
will display the value of ‘name’ inside span. Any changes to ‘name’ are reflected instantly from the DOM anywhere the changing is used.
ng-controller: specifies typically the JavaScript class for the granted action. Controllers are typically maintained in externaljs files.
ng-repeat: creates the very clean hook structures in your page.
piece. description
effortlessly loops by way of each item in the assortment.

Sample Code

Earlier before, the ng-app connaissance in the tag sets typically the stage for Angular working out in the page.
Add to the site head to bring in the Angular framework itself.
points to typically the external JavaScript file or maybe files that hold the JavaScript classes your Angular iphone app will call. A very simple category, as an example, might be:
function ItemListCtrl ($scope) $scope. items sama dengan “description”: “coffee pot”, “description”: “nerf gun”, “description”: “phone”,;
Passing ng-controller ItemListCtrl”, the my imaginary JavaScript category, tells Angular what codes to run:
and double-bracket observation tells Angular what words and phrases to evaluate.
ng-repeat is a perfectly succinct repeater directive in which loops through the current assortment and does the specified action or maybe provides the specified data. Its so simple and clean.
Goods on my desk: item. outline
This simple set up displays:
Stuff on my desk: java pot nerf gun telephone

Leave a Reply