Angularjs most commonly used eight functions (basics)

AngularJS uses basic knowledge

The first iteration output NG-REPEAT tag

Ng-repeat makes Table UL OL and other tags and JS perfect combination

 {{{{{}} years old.  
You can even specify the order of the output:

  Second dynamic binding NG-MODEL tab Any user input, as long as it is a value of HTML tag, it can dynamically bind the variables in JS, and is dynamic binding. 
  • For the bound variable, you can use {{}} directly Quote

    YOU INPUT Password is {{password}}
    If you are familiar with FITER You can easily output in your needs in your needs

    {1288323623006 | DATE: ‘YYYY-MM-DD HH: mm: SS Z’} }

      The third binding click event NG-Click event    You can easily use ng-click Bind the event for a tag. 


    The premise is your own pressMe method you want to define in the $ scope domain.

    Unlike the traditional OnClick method, you can even pass an object for the NG-Click method, just like this:


    Of course, Ng-DBLClick tag

    NG-SWITCH ON in the fourth partial statement, Ng-IF / NG-SHOW / NG-HIDE / NG-Disabled Tag
      The branch statement allows you to write logic on the interface 


    You May Be a father

    YOU MAY BE A Mother

    • Verification of the NG- Trim ng-minlength ng-maxlength Required NG-Pattern, etc. Input boxes, you can use the above tags to implement the verification of the user input. From the literal meaning you already know what they mean. you can passAfter scope.yourform.inputText.Error.Required, it is empty You can judge whether the input content meets NG-Pattern, Ng-Maxlength, Maxlength
    The input content obtained through $ scope.usernum is to remove the front and rear blank, because the presence of NG-TRIM.

    NG-Options tag

    NG-Options is a label specially built for the pull-up box.

    displayed in the pull box is Person.Name, when you select it When one, you can get the person’s Person.ID.

    seventh control CSS NG-Style tag

    Ng-style helps you easily control Your Csyour Color changes the effect you want by giving MyColor, just like scope.mycolor = color: ‘blue’; scope.mycolor = {cursor: ‘Pointer’, Color: ‘Blue’}; asynchronous request HTTP object. AngularJS provides an object similar to jQuery .ajax for asynchronous requests.

    In Angularjs, the asynchronous operation is extremely advocated, so $ HTTP’s operation is unlike jQuery.ajax also provides an ASYNC parameter.

    $ http ({Method: ‘pos “, params: {id: 123}, data: {name: ‘John’, AGE: 27}, URL: “/mypath” }.success (RESPONSE, STATUS, Headers, Config) {// do anything. You want;}). Error (Function (Response, STATUS , Headers, Config);

    If you are a POST request, the data in Params will help you spelling the URL. Data in DATA will be placed in the request body.
     The above is the most commonly used eight functions of the AngularJS introduced to you. I hope that everyone will help, if you have any questions, please leave a message, the small package will reply to everyone. Thank you very much for your support of Tumi Cloud Website!                      
    © Copyright Notice
    Just support it if you like
    comment Grab the couch

    Please log in to comment