Each component has its own folder, named after the component for readability. Component folders may include an index.js
, a view.html
and style.css
file, that
are linked together by the nx.middlewares.render
middleware. Styles are scoped to the components by default.
None of the above structuring and naming pattern is mandatory for NX. I simply chose to follow these conventions for this project.
This is what each of the components is responsible for.
- hacker-news: The top level component. Adds some global filters and renders the main view.
- app-nav: Renders the navbar view.
- app-router: A very basic router component.
Not very interesting, for the 'router config' see the
view.html
of the hacker-news component instead. - dynamic-html: A component that allows the interpolation of any HTML into the view.
- story-item: Renders a single story item view.
- story-list: Fetches and renders a list of stories.
- user-page: Fetches and renders a user.
- comment-item: Renders a single comment.
- story-page: Fetches and renders a single story and all of its comments.