Merge 5caa1675bb
into 7f2596f4ab
commit
ff74411173
|
@ -70,4 +70,4 @@ var injectAlone = function (options) {
|
|||
.pipe($.inject(injectStyles, injectOptions))
|
||||
.pipe(wiredep(_.extend({}, conf.wiredep)))
|
||||
.pipe(gulp.dest(path.join(conf.paths.tmp, '/serve')));
|
||||
};
|
||||
};
|
||||
|
|
|
@ -34,6 +34,8 @@ gulp.task('watch', ['inject'], function () {
|
|||
});
|
||||
|
||||
gulp.watch(path.join(conf.paths.src, '/app/**/*.html'), function(event) {
|
||||
browserSync.reload(event.path);
|
||||
var projectPath = path.join(process.cwd(),conf.paths.src);
|
||||
projectPath = event.path.replace(projectPath, '').replace(/\\/g, '/');
|
||||
browserSync.notify({reload: projectPath});//Push notification to clien with browserSync
|
||||
});
|
||||
});
|
||||
|
|
|
@ -85,6 +85,29 @@
|
|||
<!-- angular templates will be automatically converted in js and inserted here -->
|
||||
<!-- endinject -->
|
||||
<!-- endbuild -->
|
||||
<script>
|
||||
window.onload = function () {
|
||||
___browserSync___.socket.on('browser:notify', function (data) {
|
||||
if ("reload" in data.message) {
|
||||
angular
|
||||
.element('main.ng-scope')
|
||||
.injector()
|
||||
.get('$templateCache')
|
||||
.remove(data.message.reload);
|
||||
angular
|
||||
.element('main.ng-scope')
|
||||
.injector()
|
||||
.get('$templateCache')
|
||||
.remove(data.message.reload.substring(1));
|
||||
angular
|
||||
.element('main.ng-scope')
|
||||
.injector()
|
||||
.get('$state')
|
||||
.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue