pull/107/merge
Viktor Verebelyi 2019-06-21 09:21:34 +00:00 committed by GitHub
commit ff74411173
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 3 deletions

View File

@ -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')));
};
};

View File

@ -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
});
});

View File

@ -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>