Can I override $window globally using a windowProvider in config?

884 views
Skip to first unread message

Elf

unread,
Mar 27, 2012, 2:24:31 PM3/27/12
to ang...@googlegroups.com

Hi, I was wondering how exactly I would override something globally to the app. For instance, if I want to override the $window.alert to another function for the entire application, how could I do that? I'm trying this with little luck:


var my_module = angular.module('App', ['App.1, 'App.2]);

my_module.config(function($routeProvider, $windowProvider) {

     $windowProvider.alert=my_alert_func;

 });

Thanks in advance!


 


Igor Minar

unread,
Mar 29, 2012, 1:28:20 AM3/29/12
to ang...@googlegroups.com
$window in production is really just the good old window object. so you might as well do window.alert = someFancyFn; but this sounds wrong.

what are you trying to achieve?

/i



--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/sC1RCkavtdsJ.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.

Reply all
Reply to author
Forward
0 new messages