1,js Code
The code is as follows
Copy Code
Phonecatapp.controller (' Testctrl ', [' $scope ', ' $rootScope ',function ($scope, $rootScope) {$rootScope. Name = ' This is test ';}]);Phonecatapp.controller (' Test111ctrl ',
This article describes the Angularjs use of ng-repeat and ng-if to achieve the deletion of data display effect. Share to everyone for your reference, specific as follows:
1. First, repeat the ng-repeat directive.
Ng-repeat can be repeated display
Development tools using Webstorm, not cracked, using the expiration policy: After installation is not anxious to open the program, first set the system date for a future date, such as 2020. Then open the program and try again. And then change back
Using object Simulation Injection
We can very easily use the Angularjs $provider service with an object to simulate a dependency and inject.
Examples are as follows
Angular.module (' artists ', []).
Factory (' Artists ', [' Imagestore ',
Objective
$http Service: Simply encapsulates the native object of the browser XMLHttpRequest and receives a parameter that is an object that contains the configuration content used to generate the HTTP request, which returns an promise object with
Brief introduction
In Ng's ecology, scope is at a core position, the bottom of the two-way binding of NG is actually the scope of implementation, this chapter mainly on the scope of the watch mechanism, inheritance and the implementation of the
Lattice data is usually repetitive in nature. Ng-repeat directives, which can be used to easily draw tables. The following example demonstrates using the Ng-repeat directive to draw a table.
Name
Marks
{{subject.name}} {{
An expression is used for application data binding to HTML. Expressions are written in double brackets just like {{expression}}}. The behavior in an expression is the same as the ng-bind instruction method. ANGULARJS application expressions are pure
Angularjs ng-mouseover Instruction
Angularjs instance
Executes an expression when the mouse pointer moves over the element:
Mouse move to my!
{{count} }
This instance when the mouse moves to a DIV element, the calculated
Angularjs ng-class-odd Instruction
Angularjs instance
Set class= "striped" for odd rows in a table:
{{x.Name}} {{x.Country}}
Run Result:
Alfreds Futterkiste
Germany
Berglunds SNABBK
ANGULARJS Reference Manual
ANGULARJS directives
The ANGULARJS directive used in this tutorial:
directives
Description
Ng-app
Defines the root element of an application.
Ng-bind
Binding HTML
Angularjs API
The API means application programming Interface (Application programming Interface).
ANGULARJS Global API
The ANGULARJS global API is a collection of JavaScript functions used to perform common tasks, such as:
Compare
Angularjs Select (selection box)
Angularjs can use arrays or objects to create a drop-down list option.
Use Ng-options to create a selection box
In Angularjs we can use the Ng-option directive to create a drop-down list of items that are cycled
Angularjs XMLHttpRequest
$http is a core service in Angularjs that reads data from a remote server.
Read JSON file
The following are the JSON files stored on the Web server:
http://www.runoob.com/try/angularjs/data/Customers_JSON.php
ANGULARJS Services (Service)
In Angularjs you can create your own service, or use the built-in service.
What is a service?
In Angularjs, a service is a function or object that can be used in your ANGULARJS application.
More than 30 services have
In the process of developing GUI programs, the concept of modal dialog boxes and modeless dialogs are often used.
Modal dialog box: The parent window is unable to respond to a message during the child interface activity. Exclusive User input
First of all, the need for a table:
Table structure
Name
Street
Age
>
>
>
4 line
Click on an th and sort the columnYou can alias a table headerYou can set whether a column displaysOne row below the table shows the total
In the first article of this series, we introduced AngularJS custom commands and some simple examples. In this article, we have gone through the independent scopes of AngularJS, and independent scopes are important when creating custom commands.What
In practice, there are often data with consistent data structures but in-depth uncertainties. In general, data processing uses recursive methods. For example, the presentation of an unlimited category of a website and the structure of the classified
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service