Add missing last step to making a page

Routing doesn't work unless you add the new page to the dependency list of the parent module.
pull/379/head
liquidpele 2018-02-13 20:29:53 -05:00 committed by GitHub
parent 50cda058e2
commit 1203a49020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -78,7 +78,7 @@ This will allow you to easily switch off some pages in the future if needed
})();
</code></pre>
<p>3) Then lets create empty html file called <code>my-new-page.html</code> inside of <code>src/app/pages/myNewPage</code>.</p>
<p>4) Lastly lets create ui router state for this page. To do this we need to modify module.js file we created on step&nbsp;2:</p>
<p>4) Now lets create ui router state for this page. To do this we need to modify module.js file we created on step&nbsp;2:</p>
<pre><code class="lang-javascript">(<span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>{
<span class="meta"> 'use strict'</span>;
@ -100,6 +100,7 @@ This will allow you to easily switch off some pages in the future if&nbsp;needed
})();
</code></pre>
<p>5) Lastly, add the page to the parent module. Edit the <code>pages.module.js</code> file and add our new module to the dependency list, as well as to the sidebar definition object (for instance, under the item for "404 Page").</p>
<p>Thats it! Your can now open your new page either from sidebar or through hash&nbsp;<span class="caps">URL</span>.</p>
</div>
@ -115,4 +116,4 @@ This will allow you to easily switch off some pages in the future if&nbsp;needed
ga('send', 'pageview');
</script>
</body>
</html>
</html>