You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ This is meant to be an advanced starter, feature-rich, and include many real-wor
76
76
> When building Universal components in Angular 2 there are a few things to keep in mind.
77
77
78
78
- To use `templateUrl` or `stylesUrl` you must use **`angular2-template-loader`** in your TS loaders.
79
-
- This is already setup within this starter repo. Look at the webpack.config file [here](https://github.com/angular/universal-starter/blob/master/webpack.config.ts) for details & implementation.
79
+
- This is already setup within this starter repo. Look at the webpack.config file [here](https://github.com/MarkPieszak/aspnetcore-angular2-universal/blob/master/webpack.config.js#L58-L66) for details & implementation.
80
80
-**`window`**, **`document`**, **`navigator`**, and other browser types - _do not exist on the server_ - so using them, or any library that uses them (jQuery for example) will not work. You do have some options, if you truly need some of this functionality:
81
81
- If you need to use them, consider limiting them to only your main.client and wrapping them situationally with the imported *isBrowser / isNode* features from Universal. `import { isBrowser, isNode } from 'angular2-universal'`;
82
82
- Another option is using `DOM` from ["@angular/platform-browser"](https://github.com/angular/angular/blob/e3687706c71beb7c9dbdae1bbb5fbbcea588c476/modules/%40angular/platform-browser/src/dom/dom_adapter.ts#L34)
- The application runs XHR requests on the server & once again on the Client-side (when the application bootstraps)
90
-
- Use the [HttpCacheService ](https://github.com/MarkPieszak/aspnetcore-angular2-universal/blob/master/Client/shared/cache/api.ts), as opposed to using the `Http` service, to save certain requests so they aren't re-ran again on the Client. Use this for imports calls on pages that you expect a client to first-hit your site. Homepage, maybe a products page, etc.
90
+
- Use the [HttpCacheService ](https://github.com/MarkPieszak/aspnetcore-angular2-universal/blob/master/Client/shared/cache/api.ts), as opposed to using the `Http` service, to save certain requests so they aren't re-ran again on the Client. Use this for important `GET`'s on pages that you expect a client to first-hit your site. Homepage, maybe a products page, etc.
91
91
- Know the difference between attributes and properties in relation to the DOM.
92
-
- Keep your directives stateless as much as possible. For stateful directives, you may need to provide an attribute that reflects the corresponding property with an initial string value such as url in img tag. For our native <imgsrc=""> element the src attribute is reflected as the src property of the element type HTMLImageElement.
92
+
- Keep your directives stateless as much as possible. For stateful directives, you may need to provide an attribute that reflects the corresponding property with an initial string value such as url in img tag. For our native `<img src="">` element the src attribute is reflected as the src property of the element type HTMLImageElement.
93
93
94
94
95
95
----
96
96
97
97
### Special Thanks
98
98
99
-
Many thanks go out to Steve Sanderson from Microsoft and his amazing work on JavaScriptServices and integrating the world of Node with ASP.NET Core.
99
+
Many thanks go out to Steve Sanderson (@SteveSandersonMS) from Microsoft and his amazing work on JavaScriptServices and integrating the world of Node with ASP.NET Core.
0 commit comments