Angular (web framework): Difference between revisions

no edit summary
No edit summary
No edit summary
Line 9: Line 9:


==Usage==
==Usage==
==Deployment==
See [https://angular.io/guide/deployment Angular Guide Deployment]
The basic idea is to do the following:
# Create a production build:
#: <pre>ng build --prod</pre>
# Copy the dist folder to the server.
# Redirect missing files to index.html.
===Apache===
Place the following in the apache config for your site or in an <code>.htaccess</code> file:
{{hidden | Rewrite Rules |
<pre>
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html
</pre>
}}


==Resources==
==Resources==
* [https://angular.io/tutorial Official Angular Tutorial]
* [https://angular.io/tutorial Official Angular Tutorial]
** Teaches you to build a simple Tour of Heros app in less than 1 hour.