Using browsersync with Angular SPA, when type on text input the view (not viewModel) are updated but the model not.
Use browsersync on Angular SPA with a form and type on inputs. Print the model on the html for view if these are updated or not.
Npm [ 3.8.6 ]
[ ] linux
[ ] other _(please specify which)_
[ ] API
browserSync: {
dev: {
bsFiles: {
src : '**/*.*'
},
options: {
watchTask: true,
proxy: 'localhost:8080/app',
plugins: [
{
module: "bs-html-injector",
options: {
files: '**/*.tpl.html'
}
}
]
}
}
}
I have same problem here
I had the same problem. I was able to get it working for Angular 1.x by making few changes to index.min.js in browser-sync-client module.
Line #1185
exports.socketEvent = function (bs) {
return function (data) {
if (!bs.canSync(data, OPT_PATH)) {
return false;
}
var elem = bs.utils.getSingleElement(data.tagName, data.index);
if (elem) {
/* Check for Angularjs Application and trigger the event */
if(angular){
var ngElement = angular.element(elem);
ngElement.val(data.value);
ngElement.triggerHandler('input');
}else{
elem.value = data.value;
}
return elem;
}
return false;
};
};
Most helpful comment
I have same problem here