WOW icon indicating copy to clipboard operation
WOW copied to clipboard

Angular initialisation

Open loujaybee opened this issue 10 years ago • 3 comments

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?

loujaybee avatar Feb 02 '15 12:02 loujaybee

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

JonaMX avatar Apr 07 '15 17:04 JonaMX

it still do not work

atishoo avatar Nov 08 '16 08:11 atishoo

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

ghost avatar Aug 01 '17 14:08 ghost