print(createUser(firstName="firstName", lastName="lastName", age=20))
"typeorm": "node --require ts-node/register ./node_modules/typeorm/cli.js -d ormconfig.ts",
"migration:generate": "npm run build && npm run typeorm migration:generate ./database/migrations/%npm_config_name%",
"migration:create": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli migration:create ./database/migrations/%npm_config_name%",
"migration:run": "npm run build && npm run typeorm migration:run",
"migration:show": "npm run build && npm run typeorm migration:show",
"migration:revert": "npm run build && npm run typeorm migration:revert",
"migration:drop": "npm run build && npm run typeorm schema:drop",
"migration:fresh": "npm run build && npm run typeorm schema:drop && npm run typeorm migration:run"
npm run migration:generate --name=table
npm run migration:create --name=table
npm run migration:run
npm run migration:revert
npm run migration:show -f
npm run migration:drop
npm run migration:fresh
//ormconfig
import { DataSource } from 'typeorm';
const dataSource = new DataSource({
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'root',
password: 'root',
database: 'app1',
entities: ['dist/**/*.entity{.ts,.js}'],
synchronize: false,
migrations: ['dist/database/migrations/**/*{.ts,.js}'],
migrationsTableName: 'migrations',
});
export default dataSource;
<div class="_container mx-auto">
<div class="text-white text-xs">
<div *ngFor="let accessorie of accessories">
<app-cards [type]="accessorie.videocards" text="Видеокарты"></app-cards>
<app-cards [type]="accessorie.motherboards" text="Материнские платы"></app-cards>
<app-cards [type]="accessorie.processors" text="Процессоры"></app-cards>
<app-cards [type]="accessorie.memory" text="Оперативная память"></app-cards>
<app-cards [type]="accessorie.drives" text="SSD диски"></app-cards>
<app-cards [type]="accessorie.powerSupplies" text="Блоки питания"></app-cards>
<app-cards [type]="accessorie.processorCoolers" text="Кулеры для процессоров"></app-cards>
<app-cards [type]="accessorie.computerCases" text="Компьютерные корпуса"></app-cards>
<div class="text-red-500 p-3 text-2xl">
({{total}}р)
</div>
</div>
</div>
</div>
private templateTotal(key: any){
key.map((k: any) => {
if (k.show) {
this.sumTotal(k.price);
}
});
}
public ngOnInit(): void {
this.accessories.map((key: any) => {
this.templateTotal(key.videocards);
this.templateTotal(key.motherboards);
this.templateTotal(key.processors);
this.templateTotal(key.memory);
this.templateTotal(key.drives);
this.templateTotal(key.powerSupplies);
this.templateTotal(key.processorCoolers);
this.templateTotal(key.computerCases);
});
}