First, Angularjs basic understanding

Source: Internet
Author: User

Description: Here is a miscellaneous, there is no unified summary OH

    • ANGULARJS is the MVVM framework
    • The load JS file always uses a file with the suffix . min.js, because these files are compressed and can increase the startup speed of the application.

Module Description:

1, config can only inject provide and constant 2, factory, service is generally used to define public functions, using factory need to return an object, service and controller similar to the usual to save temporary data 3, Constant is used only to store constant information, avoid using global variables, define methods: Angular.module (' app '). Constant (myname, ' myname ') 4,Factory,service,constant,value,provider can be injected 5. run.js files need to be pre-processed in the start-up logic 6,Bootstrap relies on jquery, so you must refer to jquery when using bootstrap7, the structure of the General page:
<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "Utf-8">        <title>Angularjs Form Example</title>        <Linkhref= "Bower_components/bootstrap/dist/css/bootstrap.min.css"rel= "stylesheet">    </Head>    <BodyNg-app= "App">        <articleNg-controller= ' FormcheckctrlAs FormCheck '>            < Sectionclass= "Container-fluid">            </ Section>        </article>        <Scriptsrc= "Bower_components/angular/angular.min.js"></Script>        <Scriptsrc= "Src/config/app.js"></Script>        <Scriptsrc= "Src/config/config.js"></Script>        <Scriptsrc= "Src/config/run.js"></Script>        <Scriptsrc= "Src/filters/password.js"></Script>        <Scriptsrc= "Src/factory/platform.js"></Script>        <Scriptsrc= "Src/controllers/formcheckctrl.js"></Script>    </Body></HTML>

8. Usage of angular.extend: Some of the objects overwrite or update the values in the object, if there is no data in the object.

9, General login information and other user key information, using localstorage storage, need plug-in ngstorage

10, the use of monitoring: $scope. $watch (xxxx,xxxxx),

This is required if you use the VM form:

$scope. $watch (function () {return vm.password;}, Checkpassword);

If you use the $scope form:

$scope. $watch ("$scope. Password", Checkpassword);

First, Angularjs basic understanding

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.