This article mainly introduces the ANGULARJS based on the page to visit the dynamic Load controller solution, the need for friends can refer to the next
Ng is just want to do a single page application (Simple page application), is the hope that all
Build a NG form
1. Make sure that the label on the form has a name attribute, as in the following example. It's better to add a novalidate= "novalidate."
Cannot have an action attribute in 2.form. Submitted to Ng-submit for processing
3. Each
This example describes the MVC architecture of ANGULARJS. Share to everyone for your reference, specific as follows:
The MVC application architecture originated in the Smalltalk language as early as 1970 and was later used extensively in desktop
ANGULARJS Unit Test
There are many tutorials on the web for unit testing, such as how to install Jasmine and ngmock, and you can search for them. It's not here to say. The following focuses on the process of a unit test.
Load a module
Angularjs
Tree-shaped structure
The tree structure has many forms and realizes the way, the Ztree may say is one kind of relatively concise and beautiful and realizes also relatively simple. Ztree is a multifunctional "tree plug-in" that relies on jquery
An API that can't be found?Angularjs provides some encapsulation of functionality, but when you try to access these features through the global object angular, you find that it's very different from the ones you've encountered before.
$http For
We did a lot of basic training in the last step, so now we can do some simple things. We want to add the full text search function (yes, this is really very simple!) )。 At the same time, we will write an end-to-end test, because a good end-to-end
The ANGULARJS directive is used to extend HTML. These are the special attributes from the ng-prefix first. We will discuss the following instructions:
Ng-app-This instruction initiates a ANGULARJS application.
Ng-init-This instruction initializes
Angularjs Ng-model Instruction
Angularjs instance
The value of the bound input box to the scope variable:
input The value of the input box is bound to the variable "name":
{{name}}
This example demonstrates how to use the
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 HTML DOM
ANGULARJS provides instructions for binding application data for attributes of HTML DOM elements.
ng-disabled directives
The ng-disabled directive binds the application data directly to the disabled properties of the HTML.
Angularjs Ng-class-even Instruction
Angularjs instance
Set class= "striped" for even-numbered rows of the table:
{{x.Name}} {{x.Country}}
Run Result:
Alfreds Futterkiste
Germany
Berglunds
I've been reading Angularjs for some time and I feel like a good frame and I want to have a chance to try to do something with it.jquery Ztree is a very good jquery plug-in, full-featured, documents and APIs are also very friendly, before the
We can use the built-in $http service to communicate directly with the outside. The $http service simply encapsulates the native XMLHttpRequest object of the browser.
1, Chain call
$http Service is a function that accepts only one parameter, which
Filters (filter), as its name, function by receiving an input, processing it through a rule, and then returning the processed result. It is mainly used in the format of data, such as getting a subset of an array, sorting the elements in a group, and
Problem
When using Typeahead, there is a requirement that when the user selects one of the items, the ID of the project is saved to a different variable, and then the ID is sent to the server when the form is submitted.
However, in Typeahead, the
Page Display effect:Page HTML code: Select Company name Business Address Status {{l.name}}{{l.address}}{{l.status_str}} Home { {Page}} Last Total: {{count}} bar JS Code:var app = Angular.module ("myApp", []); App.controller ("Map_ctrl",
"Introduction to Features"Similar to the modification of personal information, click on the avatar, you can complete the selection of photos, upload photos and other steps to achieve the purpose of replacing the avatar."Run Process"(1) Click the
Read Catalogue
Inferred injection
Tagged injection
Inline-Injection
$injector Common methods
Sample code
There are also concepts of dependency injection in Angularjs, like dependency injection in spring, but
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