黃建中
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Cordova + Onsen UI + AngularJS + TypeScript ## Cordova ![cordova Application](https://cordova.apache.org/static/img/guide/cordovaapparchitecture.png) ### WebView The Cordova-enabled WebView may provide the application with its entire user interface. On some platforms, it can also be a component within a larger, hybrid application that mixes the WebView with native application components. (See Embedding WebViews for details.) ### Plugins Plugins are an integral part of the cordova ecosystem. <span style="color:blue">They provide an interface for Cordova and native components to communicate with each other and bindings to standard device APIs.</span> This enables you to invoke native code from JavaScript. [Cordova Official Web Site](https://cordova.apache.org/) [ngCordova ](https://github.com/ionic-team/ng-cordova) ## Onsen UI ### What is Onsen UI? A large set of rich UI components specifically designed for mobile apps Packed with ready-to-implement features following native iOS and Android design standards Free to use, 100% open source software (Apache v2 license) ### The fastest way to develop beautiful HTML5 hybrid and mobile web apps Experience streamlined development with zero-time setup, using the technologies you already know and love - Javascript, HTML and CSS. ![](https://onsen.io/images/common/top_img_fastest_way.png) ### Native look and feel with lots of ready-to-use components and automatic styling A rich variety of UI components specially designed for mobile apps. Onsen UI provides tabs, side menu, stack navigation and tons of other components such as lists and forms. They all have iOS and Android Material design support, with automatic styling that will change the appearance of the app based on the platform. With Onsen UI you can truly support both Android and iOS with the same source code. ![](https://onsen.io/images/landing/onsen_ui_simplest_components.png) ### Performance optimized for mobile Worried that PhoneGap / Cordova apps are slow? Fear not! All animations in Onsen UI have been tuned and optimized to perform well on a wide range of devices. We take great care to ensure that apps made using Onsen UI feel smooth even on lower end devices. ### Easy to learn Onsen UI is easy to learn while being a powerful tool to create complex mobile apps. We have lots of learning resources including official documentation, an interactive tutorial and a community forum where your questions get answered. ### Future-Proof Architecture Under the hood, Onsen UI consists of three layers: 1. CSS Components, written in cssnext, the next generation of CSS 2. Web Components, written in native JavaScript to support ALL frameworks 3. Framework Bindings, created for tighter integration with popular frameworks such as [Vue.js](https://onsen.io/v2/guide/vue/#vue-js), [AngularJS 1](https://onsen.io/v2/guide/angular1/#angularjs-1-x), [Angular 2+](https://onsen.io/v2/guide/angular2/#angular-2), and [React](https://onsen.io/v2/guide/react/#react) ![](https://onsen.io/images/guide/architecture.png) [Onsen UI Official Web Site](https://onsen.io/) ### [additional-features](https://onsen.io/v2/guide/features.html#additional-features) ### [components-compilation](https://onsen.io/v2/guide/compilation.html#components-compilation) #### Page & Toolbar Compilation ![](https://i.imgur.com/KOxReJN.png) ```htmlmixed= <ons-page ng-controller="PageController as page" class="page ng-scope" shown=""> <ons-toolbar class="toolbar"> <div class="left toolbar__left"> <ons-toolbar-button class="toolbar-button"> <ons-icon icon="ion-chevron-left, material:md-menu" class="ons-icon ion-chevron-left ons-icon--ion"></ons-icon> </ons-toolbar-button> </div> <div class="center toolbar__center toolbar__title ng-binding">My app</div> <div class="right toolbar__right"> <ons-toolbar-button class="toolbar-button"> <ons-icon icon="ion-navicon, material:md-menu" class="ons-icon ion-navicon ons-icon--ion"></ons-icon> </ons-toolbar-button> </div> </ons-toolbar> <div class="page__background"></div><div class="page__content"> <p style="text-align: center"> <ons-button ng-click="page.showAlert('Hello world!')" class="button">Click me!</ons-button> </p> </div> </ons-page> ``` [ons-page link](https://onsen.io/v2/api/angular1/ons-page.html) ### [page-lifecycle](https://onsen.io/v2/guide/lifecycle.html#page-lifecycle) Due to the asynchronous nature of JavaScript and animations, Onsen UI provides ons-page life cycle to perform actions at the right time. Loading data, updating the view, saving data before destroying… all of these and more actions are examples of what can be done thanks to page’s life cycle. #### Events <a style="color:red"><ons-page></a> provides a set of DOM events that will be fired in unique and set times of its life cycle. Use these events to alter the behavior on each page. <a style="color:red;font-weight:500">init event</a> is fired after <ons-page> is attached to DOM. Use this event to initialize the code or dynamic content of a page when it is created (before it is shown). <a style="color:red;font-weight:500">destroy event</a> is fired before <ons-page> is destroyed and prior to DOM detachment. Use this event to clean up or save anything you need. <a style="color:red;font-weight:500">show event</a> is fired every time <ons-page> comes into view, i.e. when a new page is created and shown immediately or when an existing page shows up. Use this event to run code every time a page appears. <a style="color:red;font-weight:500">hide event</a> is fired every time <ons-page> disappears from view, i.e. when a visible page is destroyed or is hidden but still exists in the page stack. Use this event to run code every time a page disappears. ### Components #### [css components](https://onsen.io/v2/api/css.html) #### [angularjs components](https://onsen.io/v2/api/angular1/) ### Monaca - Cloud IDE: Online development platform that runs on your browser. - Command Line Tool: Local tooling is available using Monaca CLI and Localkit (desktop app). - Debugger: Debug Onsen UI apps running on your mobile device. Simply download from Google Play Store and App Store. - Remote Build: Build iOS and Android app without installing SDKs, even from a Windows machine. - Continuous Integration: - Cordova Power Plugins: various add-ons to your application for professional and enterprise use. The features include HTML5 & JavaScript encryption, in-app updater and secure storage. - Push Notifications & Remote User: With Monaca Backend, you can enable remote push notifications to the application with very few steps. Also comes with remote user management and collections. ![](https://monaca.io/img/home/img01_01.png) Monaca is a commercial service but can be started for free. For more details, [visit Monaca Website](https://monaca.io/). #### Monaca x Onsen UI CLI ![](https://i.imgur.com/yJTsyWe.png) ## 開發環境及工具 ### 開發環境 - Install [NodeJS](https://nodejs.org/) - Open a Terminal (on a Mac) or a Command Prompt (on a Windows computer). `Run npm install -g cordova` - If you're planning on targeting iOS devices, Set up your machine by following instructions at iOS Platform Guide from Apache Cordova - Install Xcode. After Installed run `xcode-select --install` on Terminal - Install HomeBrew on your Mac. - Open a Terminal and run `brew install ideviceinstaller ios-webkit-debug-proxy` - Deployment Tools : run `npm install -g ios-deploy` on Terminal - [Cordova iOS Platform Guide](https://cordova.apache.org/docs/en/latest/guide/platforms/ios/index.html) - If you're planning on targeting Android devices, set up your machine by following instructions at [Android Platform Guide from Apache Cordova](https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html) ### 開發工具 - [Visual Studio Code](https://code.visualstudio.com/) + [Cordova Tools Extension](https://github.com/Microsoft/vscode-cordova) - Visual Studio + [TACO](https://blogs.msdn.microsoft.com/ericsk/2015/10/07/taco-microsoft-apache-cordova/) ## Let's Go ![](https://i.imgur.com/7w0BkY9.png) ![](https://i.imgur.com/nGDIioE.png) ![](https://i.imgur.com/V8EAfh3.png) ## 專案結構 ![](https://i.imgur.com/OeyQqIf.png) ## Debug By Cordova Tools Extension ![Add Debug Config](https://i.imgur.com/4QlfRhD.png) ![Choose Which Way You Want to Debug](https://i.imgur.com/XSZpTcf.png) ![Cordova Tools Extension Simulate](https://i.imgur.com/nalVmlx.png) ![Chrome Debug](https://i.imgur.com/885P05e.png) `npm install --save-dev @types/angular`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully