2016-01-14 57 views
2

是否possiable使用離子與ui-router.stateHelper離子與UI的router.stateHelper

我想用這個幫助我與嵌套視圖的工作: 財產children就是我要找的。 如果它不可能,我怎麼能做類似的事情,而不用定義每個孩子的名字:parent.child

安裝和進口即時得到下一個錯誤後:

TypeError: Cannot read property '@' of undefined at updateView (http://localhost:8100/lib/ionic/js/ionic.bundle.js:62199:69) 
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:62194:9 
at invokeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:21830:9) 
at nodeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:21330:11) 
at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20721:13) 
at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20725:13) 
at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20725:13) 
at publicLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20596:30) 
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:14815:27 
at Scope.$eval (http://localhost:8100/lib/ionic/js/ionic.bundle.js:29026:28) <ion-nav-view class="view-container" nav-view-transition="ios"> 

回答

1

好吧這是工作。我有問題的indjection。 這是正確的方式:(使用browserify IM)

NPM安裝角度-UI-router.statehelper

然後在package.jsonbrowser

"angular-ui-router-helper": "./node_modules/angular-ui-router.statehelper/statehelper.min.js" 

和下browserify-shim

然後在index.js中:

var rootModule = angular.module('AppName', ['ionic',require('angular-ui-router-helper').name]); 

那麼在哪裏注入stateHelperProvider到配置方法:)