This solution solved my issue :
by @escapedcat from this github issue
page :
gulpfile.js
: comment out the FA router part :
// Copies your app's page templates and generates URLs for them
gulp.task('copy-templates', ['copy'], function() {
return gulp.src('./client/templates/**/*.html')
// .pipe(router({
// path: 'build/assets/js/routes.js',
// root: 'client'
// }))
.pipe(gulp.dest('./build/templates'))
;
});
index.html
: remove the routes.js
<script src="/assets/js/foundation.js"></script>
<!-- <script src="/assets/js/routes.js"></script> -->
<script src='//maps.googleapis.com/maps/api/js?sensor=false'></script>
<script src="/assets/js/app.js"></script>
app.js
: comment out the dynamicRouting modules and modify the config part :
angular.module('application', [
...
//foundation
'foundation',
// 'foundation.dynamicRouting',
// 'foundation.dynamicRouting.animations',
...
])
.config(
function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('yourstate', {
url: '/yoururl',
templateUrl: 'templates/yourTemplate.html',
controller: 'YourController',
resolve: {
// you can use resolve here, yay!
// promiseFooData: ['Restangular', function(Restangular) {
// return Restangular.one('foo').get();
// }]
}
});
})
.run(run)
;
You need a .state
entry for each route/template you had before.
In this example the part before looked like this :
---
name: yourstate
url: /yoururl
controller: YourController
---
NOTE: Animation may also be added to state
(after version 1.1 I guess) :
$stateProvider
.state('home', {
url: '/',
templateUrl: 'templates/home.html',
animation: {
enter: 'slideInDown',
leave: 'fadeOut'
}
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…