Simple Introduction
Angularjs is designed to overcome the lack of HTML in building applications. First of all, Html is a good declarative language for static text presentation design, but it seems weak to build a Web application.
In general, we can use the following techniques to solve the problem of static Web page technology in building dynamic applications:
1. Class Library-class library is a collection of functions that can help you write Web applications. It's your code that dominates, and it's up to you to decide when to use the class library. such as jquery, etc.
2. Framework-Framework is a special, already implemented Web application that you only need to populate with specific business logic. The framework here is the dominant one, and it is used to invoke your code based on the specific application logic. The frameworks are: Knockout, Sproutcore, Easyui and so on.
Angularjs used a different approach to trying to make up the flaws in the HTML itself in building the application. It allows the browser to recognize the new syntax by using some internally agreed-upon structures. For example:
1. Use {{}} double curly braces for two-way binding
2. Use the DOM control structure to iterate or hide dom fragments
3. Support validation of forms and forms
4. Ability to associate logical code to related DOM elements
5. The ability to encapsulate HTML as reusable components
What solutions It offers
Angularjs is trying to be an end-to-end solution in Web applications. The popular point understands the front-end to the backend. This allows ANGULARJS to be flexible when building a CRUD program. Some of its outstanding performance are:
All the things you might use to build your Web app are:
1. Functional aspects: Data binding, basic template identifiers, form validation,Url routing, deep linking, build reuse, Dependency injection
2. Testing aspects: Unit testing, end-to-end testing, simulation and automated testing frameworks
AngularJS:
https://angularjs.org/
The first ANGULARJS program that creates the classic app Hello Word:
1<!doctype html>2<!--1.0ng-app tells Angularjs to process the entire HTML page and boot the application--345<script src="Http://code.angularjs.org/angular-1.0.1.min.js"></script>6<title>HelloWorld</title>78<body>9<!--2.0ng-model refers to model variables bound to yourname (ViewModel)--TenYour Name: <input type="text"Ng-model="yourname"Placeholder=" World"> One A<!--3.0{{}} is binding yourname to text-- -Hello {{yourname| |' World'}}! -</body> the
You can try entering your name in the input box and the name you type will be immediately updated to the greeting. This is the concept of two-way binding.
three components of the Angularjs
Templates (temtemplates)
Templates are files that you write in HTML and CSS to show the view of your app. You can add new elements and attribute tags to HTML as instructions for the Angularjs compiler. The ANGULARJS compiler is fully extensible, meaning that by angularjs you can build your own HTML markup in HTML!
Application logic and Behavior (Behavior)
The application logic and behavior are the controllers that you define with JavaScript. Angularjs Unlike standard AJAX applications, you do not need to write listeners or DOM controllers separately because they are already built into the ANGULARJS. These features make your application logic easy to write, test, maintain, and understand.
(data)
Models are derived from the properties of Angularjs scope objects. The data in the model is probably a JavaScript object, an array, or a primitive type, which is not important, and it is important that they belong to the Angularjs scope object.
ANGULARJS maintains a bidirectional synchronization of the data model and the view interface UI through scopes. Once the model state changes, ANGULARJS is immediately refreshed and reflected in the view interface, and vice versa.
In addition, it provides some useful features:
1. The underlying services include dependency injection, XHR, caching, URL routing, and browser abstraction services.
2. You can extend and add your own specific app services.
3. These services make it easy for you to write Web applications.
Angular.js Getting Started Tutorial