Case: 1 Ionic framework+angularjs+asp.net MVC WebApi JSONP Mobile Development

Source: Internet
Author: User

After sweeping the leaves of the garden sweep, but also gently shake the tree, shake off a few leaves, this is the state of Wabi Sabi.

Description: Ionic is a mobile framework, angularjs this needless to say, ASP. NET MVC Webapi provides data source, open Data interface

Happy Learning Ionic FRAMEWORK+PHONEGAP Handbook 1-1{creating an app project {Click to view}

Happy Learning Ionic framework+phonegap Manual 1-2{introduction header,content,footer use}{Click to view}

Happy Learning Ionic framework+phonegap manual 1-3{Panel Toggle}{Click to view}

Happy Learning Ionic framework+phonegap manual 1-4 {login Page}{Click to view}

Happy Learning Ionic framework+phonegap manual 1-5 {IO switch}{Click to view}

1. Installing WEBAPICONTRIB.FORMATTING.JSONP

2. Modify Global.asax.cs

// Jsonp GlobalConfiguration.Configuration.AddJsonpFormatter ();

3. Design the database to access the JSONP data through this address.

4.Index page code, note here to use Angular.js, the key code

<!DOCTYPE HTML><HTMLNg-app= "Ionicapp">  <Head>    <MetaCharSet= "Utf-8">    <Metaname= "Viewport"content= "initial-scale=1, maximum-scale=1, User-scalable=no, Width=device-width">    <title></title>    <Linkhref= "Lib/ionic/css/ionic.css"rel= "stylesheet">    <Linkhref= "Css/style.css"rel= "stylesheet">    <!--IF using Sass (Run Gulp Sass first), then uncomment below and remove the CSS includes above <link href= "css/ion Ic.app.css "rel=" stylesheet "> -    <script  src= "Js/angular.js"></script>     <!--Ionic/angularjs JS -    <Scriptsrc= "Lib/ionic/js/ionic.bundle.js"></Script>    <!--Cordova Script (this would be a 404 during development) -    <Scriptsrc= "Cordova.js"></Script>    <!--your app ' s JS -    <Scriptsrc= "Js/app.js"></Script>  </Head> <BodyNg-controller= "Myctrl">    <Ion-header-barclass= "Bar-positive">      <H1class= "title">Van Cool Network</H1>    </Ion-header-bar>    <ion-content>      <Divclass= "List">     <ang-repeat= "Item in Items"href= "#/{{item." MenuID}} "class= "Item Item-thumbnail-left">          <imgng-src= "http://192.168.1.100/sas.appsite/{{item. Menuicon}} ">          <H2>{Item.} MenuName}}</H2>                 </a>         </Div>    </ion-content>  </Body></HTML>

5.APP Js Code

var phonecatapp =angular.module (' Ionicapp ', [' Ionic '])phonecatapp.controller (    function  Myctrl ($scope, $http) {    $http. Jsonp ("Http://192.168.1.100/SAS. Appsite/api/menuapi?callback=json_callback "). Success (function//  data  $ Scope.items =   });

6. In the Computer browser display effect, the effect is displayed well, import into the phone inside the command:Ionic run Android details can { Click View } method

7. After importing to the phone, run the effect.

Case: 1 Ionic framework+angularjs+asp.net MVC WebApi JSONP Mobile Development

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.