feat(dom): add location and history as DOM-like APIs.
Instead of global access methods.
This commit is contained in:
@@ -307,4 +307,10 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||
return document.body;
|
||||
}
|
||||
}
|
||||
getHistory() {
|
||||
return window.history;
|
||||
}
|
||||
getLocation() {
|
||||
return window.location;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,4 +372,10 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||
return document.body;
|
||||
}
|
||||
}
|
||||
getHistory() {
|
||||
return window.history;
|
||||
}
|
||||
getLocation() {
|
||||
return window.location;
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -283,4 +283,10 @@ export class DomAdapter {
|
||||
getGlobalEventTarget(target:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
getHistory() {
|
||||
throw _abstract();
|
||||
}
|
||||
getLocation() {
|
||||
throw _abstract();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,4 +281,10 @@ class Html5LibDomAdapter implements DomAdapter {
|
||||
bool supportsNativeShadowDOM() {
|
||||
throw 'not implemented';
|
||||
}
|
||||
getHistory() {
|
||||
throw 'not implemented';
|
||||
}
|
||||
getLocation() {
|
||||
throw 'not implemented';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,6 +523,12 @@ export class Parse5DomAdapter extends DomAdapter {
|
||||
return this.defaultDoc().body;
|
||||
}
|
||||
}
|
||||
getHistory() {
|
||||
throw 'not implemented';
|
||||
}
|
||||
getLocation() {
|
||||
throw 'not implemented';
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: build a proper list, this one is all the keys of a HTMLInputElement
|
||||
|
||||
Reference in New Issue
Block a user