Skip to content

Commit 0168f5a

Browse files
committed
Initial commit
0 parents  commit 0168f5a

9 files changed

+260
-0
lines changed

.vscode/snippets.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3+
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4+
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5+
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6+
// $1, $2 for tab stops, $0 for the final cursor position, and \${1:label}, \${2:another} for placeholders.
7+
// Placeholders with the same ids are connected.
8+
// Example:
9+
// "Print to console": {
10+
// "scope": "javascript,typescript",
11+
// "prefix": "log",
12+
// "body": ["console.log('$1');", "$2"],
13+
// "description": "Log output to console"
14+
// }
15+
}

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Adding-Multiple-Block-Using-Button-Basic-
2+
3+
[Edit on StackBlitz ⚡️](https://stackblitz.com/edit/angular-qztgxf)

angular.json

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"demo": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"prefix": "app",
11+
"schematics": {},
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/demo",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"assets": [],
20+
"styles": ["src/global_styles.css"],
21+
"scripts": []
22+
},
23+
"configurations": {
24+
"production": {
25+
"fileReplacements": [
26+
{
27+
"replace": "src/environments/environment.ts",
28+
"with": "src/environments/environment.prod.ts"
29+
}
30+
],
31+
"optimization": true,
32+
"outputHashing": "all",
33+
"sourceMap": false,
34+
"extractCss": true,
35+
"namedChunks": false,
36+
"aot": true,
37+
"extractLicenses": true,
38+
"vendorChunk": false,
39+
"buildOptimizer": true
40+
}
41+
}
42+
},
43+
"serve": {
44+
"builder": "@angular-devkit/build-angular:dev-server",
45+
"options": {
46+
"browserTarget": "demo:build"
47+
},
48+
"configurations": {
49+
"production": {
50+
"browserTarget": "demo:build:production"
51+
}
52+
}
53+
},
54+
"extract-i18n": {
55+
"builder": "@angular-devkit/build-angular:extract-i18n",
56+
"options": {
57+
"browserTarget": "demo:build"
58+
}
59+
},
60+
"test": {
61+
"builder": "@angular-devkit/build-angular:karma",
62+
"options": {
63+
"main": "src/test.ts",
64+
"polyfills": "src/polyfills.ts",
65+
"tsConfig": "src/tsconfig.spec.json",
66+
"karmaConfig": "src/karma.conf.js",
67+
"styles": ["styles.css"],
68+
"scripts": [],
69+
"assets": ["src/favicon.ico", "src/assets"]
70+
}
71+
},
72+
"lint": {
73+
"builder": "@angular-devkit/build-angular:tslint",
74+
"options": {
75+
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
76+
"exclude": ["**/node_modules/**"]
77+
}
78+
}
79+
}
80+
}
81+
},
82+
"defaultProject": "demo"
83+
}

package.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "qgnioqqrg.github",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"ng": "ng",
7+
"start": "ng serve",
8+
"build": "ng build",
9+
"test": "ng test",
10+
"lint": "ng lint",
11+
"e2e": "ng e2e"
12+
},
13+
"dependencies": {
14+
"@angular/animations": "^15.1.2",
15+
"@angular/common": "^15.1.2",
16+
"@angular/compiler": "^15.1.2",
17+
"@angular/core": "^15.1.2",
18+
"@angular/forms": "^15.1.2",
19+
"@angular/platform-browser": "^15.1.2",
20+
"@angular/platform-browser-dynamic": "^15.1.2",
21+
"@angular/router": "^15.1.2",
22+
"@popperjs/core": "^2.11.6",
23+
"bootstrap": "^5.2.3",
24+
"rxjs": "^7.8.0",
25+
"tslib": "^2.5.0",
26+
"zone.js": "^0.12.0"
27+
},
28+
"devDependencies": {
29+
"@angular-devkit/build-angular": "15.1.0-next.2",
30+
"@angular/cli": "15.1.0-next.2",
31+
"@angular/compiler-cli": "15.1.0-next.2",
32+
"@types/jasmine": "~4.0.0",
33+
"jasmine-core": "~4.1.0",
34+
"karma": "~6.3.0",
35+
"karma-chrome-launcher": "~3.1.0",
36+
"karma-coverage": "~2.2.0",
37+
"karma-jasmine": "~5.0.0",
38+
"karma-jasmine-html-reporter": "~1.7.0",
39+
"typescript": "~4.7.2"
40+
}
41+
}

src/global_styles.css

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* Add application styles & imports to this file! */
2+
@import '~bootstrap/dist/css/bootstrap.min.css';

src/index.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html>
2+
<head>
3+
<title>My app</title>
4+
</head>
5+
<body>
6+
<my-app></my-app>
7+
</body>
8+
</html>

src/main.ts

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import 'zone.js/dist/zone';
2+
import { Component } from '@angular/core';
3+
import { CommonModule } from '@angular/common';
4+
import { bootstrapApplication } from '@angular/platform-browser';
5+
import { FormsModule } from '@angular/forms';
6+
import { Project } from './servce';
7+
8+
@Component({
9+
selector: 'my-app',
10+
standalone: true,
11+
imports: [CommonModule, FormsModule],
12+
template: `
13+
<h1>Hello from {{name}}!</h1>
14+
15+
<div class="container row">
16+
17+
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
18+
<div class="card">
19+
<div class="card-header">
20+
<h3 class="card-title">
21+
Temporary Project For Learning
22+
</h3>
23+
</div>
24+
<div class="card-body" *ngFor="let i of tempproejcts ">
25+
<form class="form-horizontal">
26+
<div class="row" >
27+
28+
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6" >
29+
<label class="form-label">Name</label>:
30+
<input type="text" placeholder="Please Write Name" [(ngModel)]="i.name" [ngModelOptions]="{standalone: true}">
31+
</div>
32+
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
33+
<label class="form-label">Age</label>:
34+
<input type="text" placeholder="Please Age" [(ngModel)]="i.age" [ngModelOptions]="{standalone: true}">
35+
36+
</div>
37+
38+
39+
40+
</div>
41+
42+
</form>
43+
</div>
44+
45+
</div>
46+
<button type="button" class="btn btn-primary mt-3" (click)="createreplicate($event)">Add New Block </button>
47+
</div>
48+
`,
49+
})
50+
export class App {
51+
name = 'Angular';
52+
53+
//tempproejct: any[]
54+
public tempproejct = new Project();
55+
public tempproejcts = [];
56+
57+
createreplicate(days: any) {
58+
59+
//let count = 1;
60+
//let length = this.tempproejcts.length +1;
61+
const tempobj = Object.assign({}, this.tempproejct);
62+
//tempobj.no = this.tempproejcts.length + 1;
63+
this.tempproejcts.push(tempobj);
64+
//this.tempproejcts.length + 1;
65+
66+
67+
// for(let i=0; i<length; i++){
68+
// alert(1)
69+
// tempobj[i]["no"] = count;
70+
// count++;
71+
// this.tempproejcts.push(tempobj);
72+
// }
73+
// length++;
74+
//console.log(this.tempproejcts.push(tempobj));
75+
//tempobj.no = this.tempproejcts.length+1;
76+
//for (let i = 0; i < length; i++) {
77+
// this.tempproejcts.push(tempobj);
78+
// console.log(this.tempproejcts);
79+
//}
80+
}
81+
}
82+
83+
bootstrapApplication(App);

src/servce.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export class Project {
2+
name: any;
3+
age: any;
4+
}

tsconfig.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"baseUrl": "./",
5+
"outDir": "./dist/out-tsc",
6+
"sourceMap": true,
7+
"declaration": false,
8+
"downlevelIteration": true,
9+
"experimentalDecorators": true,
10+
"module": "esnext",
11+
"moduleResolution": "node",
12+
"importHelpers": true,
13+
"target": "es2015",
14+
"typeRoots": ["node_modules/@types"],
15+
"lib": ["es2018", "dom"]
16+
},
17+
"angularCompilerOptions": {
18+
"strictTemplates": true,
19+
"strictInjectionParameters": true
20+
}
21+
}

0 commit comments

Comments
 (0)