1

Is it possible to create static html site with angular 4 ?

The scenario is i have got angular 4 ts files then from that I want to provide index.html (with other folders, assets etc) and I do not need any server to run this.

1
  • 1
    It's possible to create a site with a single HTML file, of course. And it's possible to create a site that runs from a local filesystem. But "click on this file and everything works" is awfully broad. Commented Feb 3, 2018 at 1:04

1 Answer 1

2

If you are talking deployment perspective then Yes it is possible. Use AOT compilation and build it for production environment. If you are using angular CLI then it is as simple as

ng build --prod

The command will generate dist directory which will have html, javascript and other assets provided angular cli is properly configured.

But please note if you are using any http calls then it may not work because of the cors issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.