maciej-gurban / responsive-bootstrap-toolkit

Responsive Bootstrap Toolkit allows for easy breakpoint detection in JavaScript
MIT License
363 stars 89 forks source link

Manually initialize toolkit from Angular 6 app - advice needed #54

Closed silentFred closed 5 years ago

silentFred commented 6 years ago

Hi all,

Just wondering if anyone knows hoe one can manually initialize the toolkit's inner mechanisms to add the custom detection divs to the DOM etc?

I'm working on an Angular 6 app and struggling to make sure custom breakpoints take effect before I initialize some state in my application.

Kind regards, Fred

maciej-gurban commented 5 years ago

Sorry for late reply; you probably found the solution already. I think the solution would be to simply run the initialization before your app bootstraps, i.e. initialize the lib inside a file imported before main app file that initializes angular. If that's not possible, you could add a <script> tag before any other app-related script tags, and initialize there.