Giter VIP home page Giter VIP logo

mosh-angular-learn1's Introduction

  1. App Component
  • In order for you to pass properties from parents to child, you need to use Input decorator in order to perform properties binding
  • Input - to pass state to component
  • Output- to raise event from custom component,
  • @Input('is-favourite') - we can use alias to change the input name on template
  1. ngcontent
  • If we want to create an reusable component, we can use ng content
  • If we want to render something without putting it inside a div or other kind of html elememt, we can use ngcontainer mark up
  1. Directives
  • Structural - modify the structure of the DOM
  • Attribute - modify the attributes of DOM element
  1. *ngIf, hidden
  • The difference between 2 of them is, when ngIf is evaluated as falsie, the element is removed from the dom
  • whereas when you use hidden attribute, the element is just display: hide
  1. *ngSwitch
  • *ngIf evaluate booolean, whereas ngswitch evaluate string
  1. *ngFor
  • when we render a list of dom, a new list is rerender. Sometimes, the content of the list are the same, however angular will treat it as a new list
  • therefore, we can use TrackBy event from ngFor to track the object, code added show how we track the list by its id, and now the course id is track, list is no more render when we load the list
  1. ngClass
  • ngClass we use to render a class based on some expression
  • same as how it works as classbinding
  1. custom derivative
  • code applied demonstrate on how to make a custom derivative
  • hostListener decorator used to subscribe to the event raised by the dom object
  1. Form
  • We need to initialize form-group and form-control by given a class name
  1. Ng Model .ng-touched
  • As you can see while we applied ngModel to our form, we can access and utilise the .ng-touched .ng-pristine class
  1. Ng Model radio button
  • remember ngModel need to associate with name
  1. Drop down list
  • for the value attribute we will get the string, in order to get the object value we can use [ngValue]="method"
  • we can add multiple inside select element
  1. Reactive Form
  • In template form, we use HTML Valiation, however in reactive form, we use validators
  • FormControl(formState: initialState, validator?: ValidatorFn, asyncValidator?: AsyncValidatorFn)

mosh-angular-learn1's People

Contributors

kaixuannnn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.