WOW
WOW copied to clipboard
Angular initialisation
First off, the plugin is AWESOME!
Is there an official method to initialise the library within an angular route?
All I can find is this thread, however all of the solutions don't seem to work.
Does anyone have any suggestions?
You can place your initialization code wherever you want, but I recommend you to do it just after all the libraries has been loaded
$(document).ready(function() {
new WOW().init();
});
it still do not work
1)service Win
import {Injectable} from '@angular/core';
function _window(): any {
// return the native window obj
return window;
}
@Injectable()
export class WindowRef {
get nativeWindow(): any {
return _window();
}
}
2)call in component
constructor(private winRef: WindowRef) {
winRef.nativeWindow.WOW().init();
}