Wednesday 3 April 2019

create react js project step by step

1- install node js
2- install > npm install -g create-react-app
3- create project > create-react-app react_test
[Note App name is not allowed in capital letters]
4- change dir cd <your project name>
5- npm start

Wednesday 27 March 2019

add style in angular2 using method

isBold: boolean = false;
  fontSize: number = 40;
  isItalic: boolean = true;

  addCustomStyles() {
      let styles = {
'font-weight': this.isBold ? 'bold' : 'normal',
          'font-style': this.isItalic ? 'italic' : 'normal',
          'font-size.px': this.fontSize
      };

      return styles;
  }

<button style='color:black' [ngStyle]="addCustomStyles()">Test Button</button>