yarn add angular-no-ssr
npm install angular-no-ssr
import {NoSsrModule} from 'angular-no-ssr';
<div>
<h1>SSR Website</h1>
<no-ssr>
<!-- this component will only be rendered on client-side -->
<comments />
</no-ssr>
</div>
Use a directive ssr-placeholder
until <no-ssr />
component is mounted on client-side.
eg, show a loading indicator.
<div id="app">
<h1>SSR Website</h1>
<no-ssr>
<!-- this component will only be rendered on client-side -->
<comments />
<ssr-placeholder>
<!-- this component will only be rendered on server-side -->
<loading />
</ssr-placeholder>
</no-ssr>
</div>
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
angular-no-ssr © Guinard Arnaud, Released under the MIT License.
Authored and maintained by Guinard Arnaud with help from contributors (list).
Linkedin Guinard Arnaud · GitHub guinardA