Angular Tips For Cave People

Angular

I want to cover a couple of things that are helping me along while trying to master this new and exciting way of doing things.

  1. The latest version is called Angular and this refers to the platform we use to build applications. See Here. AngularJs is the earlier iteration that allows you to extend your HTML’s syntax. See Herejs (see what I did there?).  Meaning that anytime from here on out when you hear {{  Angular  }} people are most likely talking about Angular2 and up. I think that 5 is getting ready to drop here soon btw.
  2. It helped me to think of components as a class(ts file) and a corresponding view(html file used in the templateurl). They wont always be mutually exclusive but components are the main way in which you can build elements and add logic to a page. Keep in mind that you can insert HTML in the template of your component instead of using the templateurl and corresponding html page.
  3. A Module is essentially a way to separate pieces of your app. So you have your main app which can include a pay module. That pay module can be built separately and reused in other apps if need be. You can use Modules to create features for your app.
  4. The ‘selector’ attribute is kind of like a custom html tag that does what you told it to do in your component. I.E. @Component({ selector: ‘myCustomSelector’)} would be referred to in your html like so <myCustomSelector></myCustomSelector>. The logic for what is rendered or what this does would be in the component.ts file where that selector was defined.
  5. Angular is object oriented! You have dependency injection! Thats right! OOP JavaScript! Hence the export default class declaration at the bottom of your ts files I.E. export default class FooterComponent {} And the import statement at the top! I.E. import {Component, ViewEncapsulation} from ‘@angular/core’; If youre into that kind of thing of course.
  6. The AngularCli is hella ez.  I feel smart using the command line to create stuff.
  7. You can create mobile apps using Angular and Ionic! Im not saying that its easy but it is really neat! 
  8. There are tons of resources and places to look for info. In my humble opinion this is the future.

That’s it for my list and I hope it helps you!