Ionic不会通过路由进入状态

时间:2015-06-11 07:05:18

标签: angularjs ionic

有以下index.slim:

doctype html
html ng-app="app"
    head lang="en"
        title First phonegap application
        link href="bower_components/ionic/release/css/ionic.min.css" rel="stylesheet"
    body
        ion-header-bar
            h1.title
                | Header
        ion-content
            ion-nav-view
        ion-footer-bar
            h1.title
                | Footer
        script id="home.html" type="text/ng-template"
            | 12345
        script src="bower_components/ionic/release/js/ionic.bundle.min.js"
        script src="js/main.js"
        script src="cordova.js"

以下main.js:

angular.module("app", ["ionic"]).config([
  "$stateProvider", function($stateProvider) {
    return $stateProvider.state("home", {
      url: "/",
      templateUrl: "home.html",
      controller: "HomeController"
    });
  }
]).controller("HomeController", [
  "$scope", "$state", function($scope, $state) {
    return console.log(111);
  }
]);

当我执行localhost:8888(我使用gulp服务器)时,我可以看到页眉/页脚,但是我没有看到我的主页模板和控制台的控制台输出。我该如何解决?提前致谢!

0 个答案:

没有答案