How to `inject` `$window` object to the `config` in AngularJS

you can’t inject $window service to the config as services are not initialized at config time yet. however, you can inject them providers and get an instance. in your case:

angular.module('myApp', [])

 .config(function ($windowProvider) {
   var $window = $windowProvider.$get();
   console.log($window);
 })

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)