Gulp'u çalıştırdığımda sunucu mesajla başladı:/alamıyor. localhost: 3000/app/index.html öğesini işaret ettiğimde, site localhost: 3000/home adresine yönlendiriyor ve doğru çalışıyor. Bununla birlikte, sayfayı yeniden yüklediğimde, şu anlama geliyor: alamıyorum. şey cevapsız eğerbrowserSync's modRewrite, 'app/index.html' yolunda 'hilml5mode' için işe yaramaz
görmek için aşağıdaki yapılandırma inceleyin:
Yol erişimine:
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
jshint = require('gulp-jshint'),
browserSync = require('browser-sync')
modRewrite = require('connect-modrewrite');
gulp.task('lint', function() {
gulp.src('app/js/*.js').pipe(jshint());
});
gulp.task('serve', function() {
browserSync({
server: {
baseDir: "./",
middleware: [
modRewrite([
'!\\.\\w+$ /index.html [L]'
])
]
}
});
});
gulp.task('default', ['lint', 'serve'], function() {
gulp.watch('app/js/*.js', ['lint', browserSync.reload]);
});
açısal rota dosyası: Uygulamanın Bu benim gulpfile.js index.html
olduğunu /:
$urlRouterProvider.otherwise("/home");
$stateProvider
.state('home', {
url: "/home",
templateUrl: "app/partials/home.html",
controller: 'HomeCtrl'
})
...
Çok teşekkürler!
Github: https://github.com/yhjor1212/angular-fire-powder