scrollElements not sync with angular partials
See original GitHub issueHi there,
Issue details
I try to use browsersync as a testing tool for my angular application. I’ve got a problem with the option scrollElements who seems to not syncing elements who are in angular templates.
For example, I want to sync the scroll on a div with the class .test
. Browsersync synchronise the scroll event if this div is in index.html
(the layout), but not if this div is in a template call with ui-router.
Steps to reproduce/test case
Launch the gulp task from a terminal and test the scroll sync between Chrome and Firefox.
Please specify which version of Browsersync, node and npm you’re running
- Browsersync [ 2.13.0 ]
- Node [ 5.11.0 ]
- Npm [ 3.8.6 ]
Affected platforms
- linux
- windows
- OS X
- freebsd
- solaris
- other (please specify which)
Browsersync use-case
- API
- Gulp
- Grunt
- CLI
for all other use-cases, (gulp, grunt etc), please show us exactly how you’re using Browsersync
var gulp = require("gulp");
var browserSync = require('browser-sync');
var browserSyncSpa = require('browser-sync-spa');
gulp.task('serve', function() {
browserSync.use(browserSyncSpa({
selector: '[ng-app]',
history: {
index: './index.html'
}
}));
browserSync.init({
server: {
baseDir: './',
},
scrollElements: ['.test'],
open: false,
reloadOnRestart: true
});
});
My app architecture:
App ----node_modules ----partials --------page1.html --------page2.html ----app.js ----gulpfile.js ----index.html ----package.json
Thanks for your help
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How do I synchronize the scroll position of two divs using ...
Unfortunately, I am not having any luck finding the "Angular way" for this problem. Put simply, I need my top div (table header)...
Read more >Safari Technology Preview Release Notes - Apple Developer
Note: Shared Tab Groups and syncing for Tab Groups, Website Settings, and Web Extensions are not enabled in this release.
Read more >Angular Translation - Plunker
The reason why we are not using simply a number counter is that * the number ... Is used for deep-linking URLs to...
Read more >Неожиданные вылеты (failed to execute phase [query])
sizzleFilter?e(b,c,d):e}},pseudos:{not:X(function(a,b,c){var ... a.angular=dd,b}function e(a){return a&&"number"==typeof a.length? ... scrollElement[0].
Read more >setUpLocationSync - Angular
Works around the problem that onPopState does not trigger history. ... setUpLocationSync(ngUpgrade: UpgradeModule, urlType: "path" | "hash" = 'path') ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ended up building my own plugin for BrowserSync. If you’re interested I could post a gist of it.
@KBizien Here you go: https://gist.github.com/tuhoojabotti/b35768ba4daec99843e0c5cbab1885c5
To activate it you have to tell BrowserSync to use it in your build script:
Note: Currently this only restores scroll position when BrowserSync refreshes your page, but you should be able to extend it to sync scroll position to other instances pretty easily.