-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: switch to new approach without ReflectiveInjector
- Loading branch information
Showing
14 changed files
with
146 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ import { | |
OverlayModule, | ||
ScrollStrategy, | ||
ScrollDispatcher, | ||
CloseScrollStrategy, | ||
} from '../../core'; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {Injectable} from '@angular/core'; | ||
import {ScrollStrategy} from './scroll-strategy'; | ||
import {RepositionScrollStrategy} from './reposition-scroll-strategy'; | ||
import {CloseScrollStrategy} from './close-scroll-strategy'; | ||
import {NoopScrollStrategy} from './noop-scroll-strategy'; | ||
import {BlockScrollStrategy} from './block-scroll-strategy'; | ||
import {ScrollDispatcher} from './scroll-dispatcher'; | ||
import {ViewportRuler} from '../position/viewport-ruler'; | ||
|
||
|
||
/** | ||
* Factory that instantiates scroll strategies. Provides the built-in `reposition`, `close`, | ||
* `noop` and `block` strategies by default. | ||
*/ | ||
@Injectable() | ||
export class ScrollStrategyOptions { | ||
constructor( | ||
private _scrollDispatcher: ScrollDispatcher, | ||
private _viewportRuler: ViewportRuler) { } | ||
|
||
get(strategy: string): ScrollStrategy { | ||
switch (strategy) { | ||
case 'reposition': return new RepositionScrollStrategy(this._scrollDispatcher); | ||
case 'close': return new CloseScrollStrategy(this._scrollDispatcher); | ||
case 'noop': return new NoopScrollStrategy(); | ||
case 'block': return new BlockScrollStrategy(this._viewportRuler); | ||
} | ||
|
||
throw new Error(`Unsupported scroll strategy "${strategy}".`); | ||
} | ||
} |
Oops, something went wrong.