Angular4: Pass data from parent to child component (part 5)

Set  up an ng project, $ ng new angularcomponentpassing Create a new component, $ ng g c cockpit File: cockpit.component.ts import { Component, OnInit, Input } from ‘@angular/core’; @Component({ selector: ‘app-cockpit’, templateUrl: ‘./cockpit.component.html’, styleUrls: [‘./cockpit.component.css’] }) export class CockpitComponent implements OnInit { @Input(‘srvElement’) element: {name: string, id: number;} constructor() { } ngOnInit() { } }…Read More

Angular 4: Bootstrap & Components (part 2)

First install Bootstrap, $ npm install –save bootstrap Then add bootstrap to .angular-cli.json which can be found in the root of the project. Find the ‘styles’ and add the path for bootstrap like this, “styles”: [ “../node_modules/bootstrap/dist/css/bootstrap.min.css”, “styles.css” ], Then in the project root run, $ npm install, Create a component called ‘sum’ with, $…Read More