Streaming live at 10am (PST)

Angular4 & Webflow


I’m trying to integrate a Webflow project with Angular4.

I’ve added the webflow.js script link at the bottom of the < body > tag and included the following JS snippet to verify the init… which works.

< script >
var webFlow = Webflow || [];
webFlow.push(function() {
console.log(“webflow ready”);
</ script >

However, it’s not clear how I can trigger from Angular the destroy() and ready() Webflow functions each time “a DOM refresh” happens?


Any pointers would be very welcome!



Found the solution!!

You need to get a native window handler in Angular, as follows :

import {Injectable} from '@angular/core';

function _window(): any {
  // return the native window obj
  return window;

export class WindowRef {
  get nativeWindow(): any {
    return _window();

Once done you can inject his in your constructor and call the related Webflow methods as seen in attached screen grab.

See code in action @

1 Like