离子发球不会发生变化

时间:2014-10-21 20:06:51

标签: javascript android angularjs ionic-framework

我是Ionic Framework的新手,我在Mac上。当我将更改(cmd-S)保存到index.html时,我会立即在浏览器中看到我的更改。

但是,当我运行命令'ionic serve'或'ionic run android'时,我没有看到我的更改,而是向我展示了几个小时前我添加的内容。我很想提供图像,但我需要10个代表来添加图像。我希望我的代码足以帮助我。

 <link href="lib/ionic/css/ionic.css" rel="stylesheet">
 <link href="tutorial.css" rel="stylesheet">

<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic/js/ionic.angular.js"></script>

 <!-- Needed for Cordova/PhoneGap (will be a 404 during development) -->
 <script src="js/app.js"></script>

 <script src="cordova.js"></script>

<body ng-app="chApp" animation="slide-left-right-ios7">

 <ion-nav-bar class="nav-title-slide-ios7 bar-light">
   <ion-nav-back-button class="button-icon ion-arrow-left-c"></ion-nav-back-button>
 </ion-nav-bar>

 <ion-nav-view></ion-nav-view>

 <script id="templates/intro.html" type="text/ng-template">

   <ion-view>

     <ion-nav-buttons side="left">
        <button class="button button-positive button-clear no-animation" ng-click="startApp()" ng-if="!slideIndex">Skip Intro</button>
        <button class="button button-positive button-clear no-animation" ng-click="previous()" ng-if="slideIndex > 0">Previous Slide</button>
    </ion-nav-buttons>

    <ion-nav-buttons side="right">
      <button class="button button-positive button-clear no-animation" ng-click="next()" ng-if="slideIndex != 4">Next</button>
      <button class="button button-positive button-clear no-animation" ng-click="startApp()" ng-if="slideIndex == 4">Begin</button>
    </ion-nav-buttons>

    <ion-slide-box on-slide-changed="slideChanged(index)">

      <ion-slide>
        <h2>Welcome to Classroom Hero! Swiping is the easiest way to navigate the app. Swipe now to begin the tutorial!</h2>
      </ion-slide>

      <ion-slide>
        <h2>Reward Stamp Screen</h2>
      </ion-slide>

      <ion-slide>
        <h2>Market Stamp Screen</h2>
      </ion-slide>

      <ion-slide>
        <h2>Jar Stamp Screen</h2>
      </ion-slide>

       <ion-slide>
        <h2>Registration Stamp Screen</h2>
      </ion-slide>

    </ion-slide-box>
  </ion-view>

</script>

<script id="templates/tabs.html" type="text/ng-template">
<ion-tabs class="tabs-icon-only tabs-positive">

  <ion-tab title="Reward" icon-on="ion-ios7-filing" icon-off="ion-ios7-filing-outline" ng-controller="MainCtrl">

    <header class="bar bar-header bar-positive">
      <h1 class="title">Reward</h1>
    </header>
    <ion-content has-header="true">
      <h1>Deadlines</h1>
    </ion-content>
  </ion-tab>

  <ion-tab title="MarketPlace" icon-on="icon ion-ios7-clock" icon-off="icon ion-ios7-clock-outline">
    <header class="bar bar-header bar-positive">
      <h1 class="title">MarketPlace</h1>
    </header>
    <ion-content has-header="true">
      <h1>Deadlines</h1>
    </ion-content>
  </ion-tab>

  <ion-tab title="Classrom Jar" icon-on="icon ion-ios7-gear" icon-off="icon ion-ios7-gear-outline">
    <header class="bar bar-header bar-positive">
      <h1 class="title">Classroom Jar</h1>
    </header>
    <ion-content has-header="true">
      <h1>Settings</h1>
    </ion-content>
  </ion-tab>

 </ion-tabs>
</script>

这是我的javascript文件

angular.module('chApp', ['ionic'])

.config(function($stateProvider, $urlRouterProvider) {

 $stateProvider
 .state('intro', {
  url: '/',
  templateUrl: 'templates/intro.html',
  controller: 'IntroCtrl'
 })
.state('tabs', {
  url: '/tabs',
  templateUrl: 'templates/tabs.html',
  controller: 'MainCtrl'
 });

$urlRouterProvider.otherwise("/");

})

.controller('IntroCtrl', function($scope, $state, $ionicSlideBoxDelegate) {

  // Called to navigate to the main app
  $scope.startApp = function() {
  $state.go('tabs');
 };
 $scope.next = function() {
   $ionicSlideBoxDelegate.next();
 };
 $scope.previous = function() {
   $ionicSlideBoxDelegate.previous();
 };

  // Called each time the slide changes
  $scope.slideChanged = function(index) {
  $scope.slideIndex = index;
  };
 })

 .controller('MainCtrl', function($scope, $state) {
  console.log('MainCtrl');

     $scope.toIntro = function(){
     $state.go('intro');
     }
   });

0 个答案:

没有答案