-
Notifications
You must be signed in to change notification settings - Fork 3
Your First Angular App
Lakshman.S edited this page Sep 5, 2020
·
2 revisions
Hi Friends, This is Lakshman here.
As part of the Series "Angular Best Practices".
Today, We will go through Practices followed on Our First Angular App.
We have covered things using Angular CLI in Windows.
If you're required to know Options to Setup Angular Environment Click Here
Prerequisites are
- Node.JS
- Angular CLI (For App Creation)
- VS Code
Once the prerequisites got installed, we will create our New Angular App at first.
Suggested Points are
In Create App in CLI:
- Finalize the CSS Style Type before creating an Angular App.
- Always Set Angular Routing By Default.
In Any Terminal:
PS E:\Lakshman_IP\Blogger\AngularPractices> ng new
? What name would you like to use for the new workspace and initial project? ngAngularPractices
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS [ https://sass-lang.com/documentation/syntax#scss ]
...
As Base Configuration:
- On build remove an app name in the output path in angular.json.
- Set port in "start" under Scripts in package.json.
- Add "--prod" in "build" under Scripts in package.json.
In angular.json
...
"build": {
...
"options": {
"outputPath": "dist",
...
}
}
...
In package.json
"scripts": {
...
"start": "ng serve --port=5200",
"build": "ng build --prod",
...
},
...
Things to Know:
- If you are going angular app source with others, they don't require to install Angular-CLI. It's available as Dev Dependencies.
You may also access to source on GitHub by Click Here
On-road head, we will discuss a lot of things.
Looking forward to your comments and share your feedback.
Until that, I am Lakshman, Signing Off.