Use angularjs to develop next-generation web applications (2): angularjs application skeleton (2) and angularjs next-generation
1.Non-invasive JavaScript
Same behavior in all browsers. Angular will help you shield differences.
The operation is not performed in the global namespace. The expression you specify can only access functions and data within the scope of
Angularjs development FAQ-2 (angularjs built-in filter), angularjs-2
Several Commonly Used filters are built in angular to simplify our operations.
The filter uses the '|' symbol, which is similar to the pipeline in linux.
1. filter)
Filter can filter data based on conditions, for example:
{{[{name:'coolcao',age:23},{name:'lily',age:20},{name:'tom',age:22}] | fi
This article mainly introduces the seven advantages of ANGULARJS, because it is very convenient, if you want to see the shortcomings of ANGULARJS, you can go to the article I recommend below to see. Now let's take a look at this article on the merits of Angularjs.
Let us first look at the seven advantages of ANGULARJS
AngualrJS is a very considerate web application framework. This article uses jQuery and Angular to implement the same instance, in this way, you can experience the differences between the two and the charm of AngularJS AngualrJS is a very considerate web application framework. It has good official documents and examples. after testing the famous TodoMVC project in the real environment, it stands out in a massive number of frameworks, and it is well de
AngualrJS is a very considerate web application framework. This article uses jQuery and Angular to implement the same instance, in this way, you can experience the differences between the two and the charm of AngularJS AngualrJS is a very considerate web application framework. It has good official documents and examples. After testing the famous TodoMVC project in the real environment, it stands out in a massive number of frameworks, and it is well de
Detailed description of AngularJS's filter usage, angularjsfilter
After learning about angularjs, the system found that some ideas of angularjs are similar to the php module smarty, such as data binding and filter. If you are familiar with smarty, learning angularjs is easier. The filter function of angularjs can be di
placed in element names, attributes, classes, and comments.
The following example shows the use of ng-init and ng-repeat to traverse an array.
For more directve usage, refer to the official website https://docs.angularjs.org/api
Filter
The effect is to receive an input, process it through a rule, and return the processed result. It is mainly used to filter arrays, sort elements in arrays, format data, and so on.
AngualrJS has built-in filters: currency, date, filter, su
Filters are used to format data that needs to be displayed to the user. Angularjs has a lot of practical built-in filters, but alsoIt's a convenient way to create your own filters.
The filter is invoked within the template binding symbol {{}} in HTML through the | symbol. For example: {{value|lowercase}}//converts a value to lowercase
Filters can be invoked through $filter in JavaScript code
Cases:
App.controller (' Democontroller ', [' $sc
System of learning a bit angularjs, found angularjs some of the ideas of the root of the PHP module Smarty very much like, for example, data binding, filter. If you are more familiar with smarty, it will be easier to learn angularjs. This article simply say Angularjs filter function,
the same time, you can add your own definition filter, the same way Angular built-in filter. In this example, a lowercase to uppercase conversion is implemented. Filter can not only format text values, but also change arrays. The AngularJS built-in format filter has number, date, currency, uppercase, and lowercase. The array filter has filter, LimitTo, and. The filter needs to be set, and the syntax format
Xing"},
{"Age":, "id": A, "name": "Test ABC"}
] | limitto:1}} //Result: [{] Ag E ":" id ": Ten," Name ":" iphone "}]
8,orderby sort of image
{{[{' Age ': "id": "Name": "iphone"},
{"Age":, "id": one, "name": "Sunm Xing"},
{"Age": "," id ":", "name": "Test ABC"}
] | By: ' ID ': true} ///root ID Descending row
{{{' age ': ' id ': ' name ': ' iphone '}, {' Age ': ' id ': ', ' name ': '
sunm Xing "},
{" Age ":," id ": A," nam
Angularjs (four basic commands in angularjs) and angularjs
Of the four basic commands,
Note that the usage of the annotated command M is
All commands can be combined with each other. If you do not write A restrict command, the attribute command is used by default.
To support IE8 browsers, it is generally best to set the command as a property.
Copyright Di
Related reading:
The ANGULARJS expression of the Angularjs introductory tutorial
ANGULARJS instructions for the ANGULARJS introductory tutorial
The ANGULARJS model (Ng-model) can bind values in HTML input fields to variables created by
change arrays. The AngularJS built-in format filter has number, date, currency, uppercase, and lowercase. The array filter has filter, LimitTo, and. The filter needs to set parameters, and the syntax format is fixed: somevalue | filtername:filterParameter1:filterParameter2....The directive constructor returns a method that is used to pass an element and modify it according to the parameters in scope. In th
constructor obtains the $ scope object, which is used to store all interfaces and methods exposed by the controller. Scope is transmitted from Angular to the view and command layer. In this example, the controller adds the msg attribute to the scope object. An application module can contain multiple controllers. Each controller performs its own duties and controls one or more views.
The filter constructor returns a method to change the display mode of input text. Angular provides many built-in
This article mainly introduces the use of filter in AngularJS, including listing some commonly used built-in filters in Angular and the methods for customizing filters, for more information, see the world of AngularJS. filter provides a method to format data. Angular also provides many built-in filters, in addition, it is quite simple to create a custom filter.
In the HTML template binding {}, we use | to
/end of the array or string interception, second, JS primitive function can replace it, see how to use it:{{Childrenarray | limitto:2}}//will display the first two items in the array.6.lowercase (lowercase)Convert the data to all lowercase. Without parameters, you can only change the entire string to lowercase, and you cannot specify a letter.7.uppercase (uppercase)Ditto.8.number (formatted number)The number filter can be divided into thousands, like
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.