DEV Community

Diogo Machado
Diogo Machado

Posted on

Tips for new Angular developer

When working with Angular know that isn't always the somethings make how you think. After along time you learning tips that can help you going the work more productive.

Use environments for the control you build

In Angular can be not so explicit but you can have more of two environments, for example, if you need an environment-specific for docker-machine, just you create a new file environment.docker.ts, you than need change angular.json for add the new file in the configuration build and serve.

"docker": {
 "fileReplacements": [
     "replace": "src/environments/environment.ts",
     "with": "src/environments/environment.docker.ts"

Enter fullscreen mode Exit fullscreen mode

If you need to use ng-serve, add line forward:

"docker": {
   "browserTarget": "app:build:docker"
Enter fullscreen mode Exit fullscreen mode

Pipes are the power of Angular

The big think about Angular into your organization and big possibles, of course, is the Pipes. They can be a superpower to process anything you need showing for your user.

Components are your friend

Another think of the power of framework Angular is the components, they can be re-used so this opens a large opportunity for your application.

Create services, primarily to connect APIs

Angular has a good structure for dividing your application, this is awesome because of stay easy for support in the future, services are special to connect with APIs and consume data.

It is just this, a hope that tips can help you in your code work.

Top comments (1)

diogom profile image
Diogo Machado

Thanks, Manev, I hope that you like Angular how I do.