Skip to content

Instantly share code, notes, and snippets.

@anghelalexandra
Created June 10, 2017 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anghelalexandra/192de3db363599829234e331efa49bb0 to your computer and use it in GitHub Desktop.
Save anghelalexandra/192de3db363599829234e331efa49bb0 to your computer and use it in GitHub Desktop.
wp-pwa-sample-add-global-configuration
const fetchConfig = () => {
const $initInjector = angular.injector(['ng']);
const $http = $initInjector.get('$http');
const $window = $initInjector.get('$window');
return $http.get(`${$window.__APPTICLES_BOOTSTRAP_DATA__.CONFIG_PATH}`);
};
...
fetchConfig()
.then(initializeConfiguration)
.then(boostrapApplication)
.catch(errorHandler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment