angularjs ui-router templateURL没有在plunker上加载

时间:2014-04-15 22:14:09

标签: angularjs angular-ui-router plunker

我的插件http://plnkr.co/edit/3WRDCv?p=preview

app.js

'use strict';

var app = angular.module('txtbinge', ['ionic', 'firebase']);

app.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
  });
});

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

  .state('app', {
    url: '/app',
    abstract: true,
    controller: 'ContentController',
    templateUrl: 'applayout.html'
  })

  .state('app.home', {
    url: '/home',
    views: {
      'centerContent' :{
        templateUrl: 'home.html'
      }
    }
  })

  //test plunker to see if stateParams are causing issues
  .state('crop', {
    url: '/crop',
    //template: 'test',
    templateUrl: 'applayout.html',
    controller: 'CropController'
  })

  .state('crop-image', {
    url: '/crop-image/:imageURI',
    //template: 'test',
    templateUrl: 'menu.html',
    controller: 'CropController'
  });

  $urlRouterProvider.otherwise('/crop');
});

尝试从cropcrop-image状态加载templateURL。它似乎不起作用。考虑app.home加载,这是非常奇怪的。有什么想法吗?

1 个答案:

答案 0 :(得分:4)

嗯,templateUrl区分大小写......