"Personal daily Management" App of "Ionic+angularjs Development" (ii)

Source: Internet
Author: User

Ready to work resource pre-installed tool

Installing Bower

1 npm install-g bower


Installing Ngcordova

1 bower installngCordova


(* Because of the network access to resources, after several construction projects can not be downloaded to, they copied the original Ngcordova directory (into the Yourproject\wwww\lib directory), found also can be used)


After downloading, refer to the INDEX.HMTL of the project:

1 <scriptsrc="lib/ngCordova/dist/ng-cordova.js">

Calendar Tools

Fullcalendar

Installing plugins

The plug-ins that are required for this project (installation) are:

plug-in name Description Extended Reading
Cordova-plugin-x-toast Message prompt, using the method such as: $cordovaToast. Showshortbottom (' Prompt at the bottom of the screen ');
(* platform-only operation, browser debugging is not valid, so when the PC debugging should be aware of the errors caused by the subsequent code is not executed)
Cordova Ionic message hint
Cordova-sqlite-storage SQLite database Cordova method of invoking local SQLite database
More ...
Cordova-plugin-x-socialsharing Content sharing


The basic commands for installing the plugin are:

1 cordova plugin add XXXX


After installation, you can see the new plugin directory in the Yourproject\wwww\lib directory so that you can reference it in your project (without using <script src= "xxx" >).
After the platform is generated, or it needs to be re-used

1 cordova prepare

This command is used to copy files to the platform (and change the contents of some XML files)

Concept Understanding Service Services

The Angularjs service is a singleton object whose main function is to provide data and objects for implementing the functionality of the application, and to simplify or block complex application functions by invoking the service directly. Depending on the functionality, there are built-in services and custom services.

Common built-in services provided by ANGULARJS are: $scope, $http, $window, $location, etc.


Custom services include the following two main types:
1) Use the built-in $provide service
2) Call the service registration in the module (such as factory, service, constant, value, etc.)


This project mainly uses service to create services (unlike factory, the service method can receive a constructor)

Design and Development app.jsView CodeCustom services: $alertPopup

For easy in-project invocation, the $ionicpopup is packaged and extended later.

Custom services: $db

This $db service is basically a DAL layer, encapsulating the basic crud functionality, and doing some "default processing" based on the project's needs (automatic creation of bookkeeping and daily tables when the program is initialized).
(* This SQLite file physical path is difficult to find, what method can be quickly located, also hope to know the Garden Friends enlighten:))

Accounting View HTML sectionView CodeJavaScript sectionView Code

Description

    • The Arragedata () function sets the last data of the day (because it is reversed, so the last one) according to the data sorted (in reverse order), so the Ext_displaydivider property of the "date-day income and expenditure item" is displayed-- Split by day later found can also use Ionic card, of course, there may also be a third-party control can be used directly.
    • $ionicModal Call the pop-up function, the popup is a complete page, the project for simplicity, directly written on the same page "< script id=" detail.html "type=" Text/ng-template ">"

Daily View HTML sectionView CodeJavaScript sectionView Code

Description

    • Daily data entry, using the "change that update" mode, where the use of $watch function to monitor data changes. At the same time for the convenience of the data update function, when the user clicks on a one-day frame, automatically determine whether the date of the data exists, does not exist insert empty data.
Extended Reading

Angularjs Data Listener function $watch

Package Release build Android Platform installation package

Use the command:

12 cordova platform add androidcordova build android

(* Note that if the above steps go wrong, the common reasons are:

    • The installed Android SDK and packaged SDK versions are incorrect, download the appropriate SDK
    • Environment variables Not configured well
    • Install the latest node. js

)

* Appendix "source File" "APK file"


Ken
Source:http://www.cnblogs.com/glife/

This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original link, otherwise reserves the right to pursue legal responsibility.

"Personal daily Management" App of "Ionic+angularjs Development" (ii)

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.