// Pass data to Dialog
constructor(
private _dialog: MatDialog
) {}
someFunction(whatever) {
let dialogConfig = new MatDialogConfig();
dialogConfig.data = {
whatever: whatever,
};
this._dialog.open(
MyDialog,
dialogConfig
);
}
// Retrieve within the dialog
constructor(
@Inject(MAT_DIALOG_DATA) private _inputParams: any
) {}
ngOnInit(): void {
this.whatever = this._inputParams.whatever;
}
Update global npm packages
// Updating all globally-installed packages
npm update -g
// or
npm install npm@latest -g
// Determining which global packages need updating
npm outdated -g --depth=0
// Updating a single global package
npm update -g <package_name>
list all globally installed npm modules
npm ls -g --depth 0
Install Specific Package Version
npm install package@1.1.1
Build Angular Project for Production w/ Relative Path
ng build --prod --base-href ./
Update all npm/Angular packages
// npm packages
npm i -g npm-check-updates
ncu -u
npm install
// angular packages
ng update --all
basic angular requirements
// global req.
npm i -g @angular/cli
Angular setup
// create new app
ng new <PROJECT_NAME>
cd <PROJECT_NAME>
// install angular material
npm i @angular/material @angular/animations @angular/cdk hammerjs
// generate components
ng g c <COMPONENT_NAME>
// generate services
ng g s <SERVICE_NAME>