Skip to main content

Posts

Showing posts from June, 2019

Typescript Basics

Typescript language is a wrapper around javascript language. Any javascript code can also be a typescript code, but typescript has additional features like Strong Typing, Object Oriented features, Catching errors during compile time. In Angular applications, all javascript code is generally written in typescript. Angular CLI under the hood compliles the typescript file into javascript before bundling in the deployable package. We can individually learn Typescript without using Angular CLI by downloading Typescript using npm (node package manager). Basic commands before working on typescript:  ---------------------------------------------------------------------------------  Command used to install typescript                           ---------------------------------------------------------------------------------  Use ctrl+~ to open the terminal window in visual    studio code    ...

Angular Basics

Angular is component based framework. Each page in application has different components and tied to the root component. Each component has its view (html) , css(stylesheets), ts(typescript files containing logic), spec.ts (used for unit testing component) Prerequisites: ------------ Download - Node.js (Runtime for angular applications) - npm (node package manager - to install dependencies for angular) - angular cli (command line interface for generating, running angular projects) Angular CLI Commands: ---------------------- ng new (creates a fresh application) ng serve (starts the application on node server) ng generate component (To create a new component) Visual Code Commands: Open a terminal window - Control + ~ Module vs Components: -------------------- Each module may have one or more components. Each component will have HTML, logic and Data. Steps to create a component: Create a component.  - Naming convention for component : .component.ts  - Components uses decorat...