This repository has been archived by the owner on Feb 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(universal): export node and browser compatible services
- decouple components from dependency on window, to allow them to be rendered on the server. - export two distinct provider sets for usage in node/browser settings. MATERIAL_NODE_PROVIDERS can be used while rendering on the server, and MATERIAL_BROWSER_PROVIDERS when running in the browser. BREAKING CHANGE: Remove static `Media.hasMedia` method and utility `rAF` function. Inject the `ViewportHelper` service for rAF, and the `Media` service for hasMedia. This static method referred to the window directly. The use of `MATERIAL_PROVIDERS` has been deprecated. Please use either `MATERIAL_NODE_PROVIDERS` or `MATERIAL_BROWSER_PROVIDERS` as is appropriate for your platform.
- Loading branch information
1 parent
ee23417
commit 67e8054
Showing
29 changed files
with
4,696 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {bind, enableProdMode} from "angular2/core"; | ||
import {bootstrap} from "angular2/platform/browser"; | ||
import {ROUTER_PROVIDERS, HashLocationStrategy, LocationStrategy} from "angular2/router"; | ||
import {MATERIAL_BROWSER_PROVIDERS} from "ng2-material/all"; | ||
import {HTTP_PROVIDERS} from "angular2/http"; | ||
import {ComponentsService} from "../../services/components"; | ||
import {NavigationService} from "../../services/navigation"; | ||
import {VersionService} from "../../services/version"; | ||
import {DemosApp} from "../../app"; | ||
|
||
if (window.location.href.indexOf('github.com') !== -1) { | ||
enableProdMode(); | ||
} | ||
bootstrap(DemosApp, [ | ||
HTTP_PROVIDERS, ROUTER_PROVIDERS, MATERIAL_BROWSER_PROVIDERS, | ||
ComponentsService, NavigationService, VersionService, | ||
bind(LocationStrategy).toClass(HashLocationStrategy) | ||
]); |
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,13 @@ | ||
import {bootstrap} from "angular2-universal-preview"; | ||
import {ROUTER_PROVIDERS} from "angular2/router"; | ||
import {MATERIAL_NODE_PROVIDERS} from "ng2-material/all"; | ||
import {HTTP_PROVIDERS} from "angular2/http"; | ||
import {ComponentsService} from "../../services/components"; | ||
import {NavigationService} from "../../services/navigation"; | ||
import {VersionService} from "../../services/version"; | ||
import {DemosApp} from "../../app"; | ||
|
||
bootstrap(DemosApp, [ | ||
HTTP_PROVIDERS, ROUTER_PROVIDERS, MATERIAL_NODE_PROVIDERS, | ||
ComponentsService, NavigationService, VersionService | ||
]); |
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
Oops, something went wrong.