mirror of
https://github.com/grafana/grafana.git
synced 2026-08-14 07:04:57 -05:00
Angular: Fixing some annoying depreaction warnings (#36466)
This commit is contained in:
@@ -18,10 +18,14 @@ export class AngularLocationWrapper {
|
||||
this.url = this.wrapInDeprecationWarning(this.url);
|
||||
}
|
||||
|
||||
wrapInDeprecationWarning = (fn: Function, replacement?: string) => {
|
||||
deprecationWarning('$location', fn.name, replacement || 'locationService');
|
||||
return fn.bind(this);
|
||||
};
|
||||
wrapInDeprecationWarning(fn: Function, replacement?: string) {
|
||||
let self = this;
|
||||
|
||||
return function wrapper() {
|
||||
deprecationWarning('$location', fn.name, replacement || 'locationService');
|
||||
return fn.apply(self, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
absUrl(): string {
|
||||
return `${window.location.origin}${this.url()}`;
|
||||
|
||||
Reference in New Issue
Block a user