Ionic,angularjs Learning Notes

Source: Internet
Author: User
1.ionic is a powerful hybrid/HYBRID_HTML5 mobile development framework, featuring the use of standard html,css,javascript and the development of Cross-platform native app applications;
2.ionic is based on ANGULARJS infrastructure development and follows ANGULARJS framework constraints;
3.ionic.js implementation of the directive basically covers the needs of mobile end development, the mobile side of the development of common UI components into ANGULARJS instructions, easy to use in the development of HTML;
4.ionic is both a CSS framework and a JavaScript UI library;
5. The purpose of this framework is to develop mobile applications from the Web side, and to implement applications compiled into various platforms based on the PHONEGAP compilation platform;
6.ionic follows the design pattern of MVC;
7.AngularJS is known as the next generation Web application, the main features are as follows: MVC, modularization, Dependency injection, bidirectional data binding (MVVM), instruction and UI control;
8.ionic integration of ANGULARJS, routing is based on Angularjs, Ionic extended the ANGULARJS instructions;
9.AngularJS tries to provide an End-to-end solution for Web applications, with server-side data only, and bidirectional data binding is the coolest and most practical feature of ANGULARJS, avoiding a large number of DOM operations and posing a threat to jquery;
10.Model and view to achieve two-way data binding, the role of controller is operation model;
11. Modules (module) is a complete business function unit, angulars with modules to organize objects;
12.AngularsJS Two kinds of scopes: $rootScope (root scope, corresponding to the data of a module), $scope (child scope, corresponding to a controller of all data);
The use of global variables in 13.AngularJS is prohibited;
14.controller this layer should be very thin, most of the business logic and persistent data should be placed in the service, controller only when needed to be initialized, once you do not need to be discarded, Each time you refresh or switch the page angular clears the current controller;
Four ways to create services in 15.AngularJS: Provider method, factory method, service method, factory and service The main difference is that factory can directly return the string, provider need to add $ This.get = function () method;
16. Use the ng-app instruction to tell Angularjs to manage that part of the DOM;
17.ng-init: Defines the initial value for the ANGULARJS and assigns the value when it starts;
18.AngularJS $scope is the main glue for connecting controllers and templates view;
19. Custom Service Factory Principle:
Use factory to create an object, add a property or function to the object, return this object, inject the service into the controller, controller can call the method directly;
20. Custom Service Principle:
Service is instantiated by the new keyword, so you should add the attribute to this, and then inject the service into the controller, and in Controler you can call the properties on this.
The two methods of 21.JavaScript:
Array.unshift (A1)//Adds one or more elements to the beginning of an array, and returns a new length
Array.push (A2);//Add one or more elements to the end of an array
After the 22.<ion-refresher> is refreshed, use the $scope. $broadcast ("Scoll.refreshcomplete") method to inform the frame;
23. Service:
$ionicScrollDelegate. ScrollTop (TRUE)/scroll to the top
$ionicScrollDelegate. Scrollbottom (TRUE)/scroll to the bottom
24. Triggers an event to be processed after an item is passed:
var index = $scope. Items.indexof (item);//Find the index of item in items
$soope. Items.splice (index,1);//Delete Specify incoming item
One way to use the Click event in 25.ionic:
Ng-click = "Flag1 =!flag1;flag2= true";//reverse when triggering event, setting values for other properties
Related Article

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.