DEV Community

Discussion on: In defense of the Angular framework

Collapse
 
jwp profile image
John Peters • Edited

I'm an Angular fan.

The Angular CLI has simplified everything about Angular.

ng new projectName
ng serve

Just 2 commands to create and serve a web application. It takes 2 minutes, and is perfect for a simple web site.

Growing the Web App through Components

// create a new component
ng g c Componentname

  • Complex applications need multiple components

    • Custom Components
      • Allow us to create custom html tags which contain specific function
      • Four files are generated in the 'Componentname' folder, the Html, Css, Typescript and Test file.
      • Include them anywhere in application by using the new HTMLTag app-componentname
      • Same concept as the native HTML 5 WebComponent
  • Rxjs was integrated to allow for subscribing to all events in Angular.

    • No more addEventListener('eventname') necessary
    • But Rxjs can be added to any framework.

Project Getting Too Large?

  • Break up areas into modules
    • There is always a root module named app.module
    • New modules define all the components for that 'area'
    • The modules allow 'group' imports of components defined within each module.

HTTP Support

  • Built in, but uses observables instead of promises!

  • The request method has 17 overloads, meaning it can do many things.

  • The get method has 15 overloads.

  • etc. etc.

Client Side Routing

  • Routes are tied to the incoming path and related to the component to handle.
  • Router Guards (add to security)

Needs Improvement🍋 <=Lemons

  • Example Documentation is poor.
  • Api Docs are a mess (IMO)
  • Migrations are messy ng update
  • Installing Angular can be difficult
  • Relatively long learning curve
  • File and folder renames don't update everything
Collapse
 
juristr profile image
Juri Strumpflohner

Project too large?

Migrate to Nx. I'm biased ofc, but long-time Nx user :)

Collapse
 
jwp profile image
John Peters • Edited

I Just read intro doc. Looks like a great library. Tx.

Thread Thread
 
juristr profile image
Juri Strumpflohner

Yeah you should 🙂

Thread Thread
 
jwp profile image
John Peters

Tx, once again. This one looks like a winner.