add-calculator-mdimran0509 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/add-calculator/add-calculator.component.css +0 -0
- package/add-calculator/add-calculator.component.html +1 -0
- package/add-calculator/add-calculator.component.spec.ts +23 -0
- package/add-calculator/add-calculator.component.ts +22 -0
- package/ng-package.json +7 -0
- package/package.json +13 -0
- package/src/lib/add-calculator.component.spec.ts +23 -0
- package/src/lib/add-calculator.component.ts +15 -0
- package/src/lib/add-calculator.module.ts +11 -0
- package/src/lib/add-calculator.service.spec.ts +16 -0
- package/src/lib/add-calculator.service.ts +9 -0
- package/src/public-api.ts +6 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
package/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# AddCalculator
|
2
|
+
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.
|
4
|
+
|
5
|
+
## Code scaffolding
|
6
|
+
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
ng generate component component-name
|
11
|
+
```
|
12
|
+
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
ng generate --help
|
17
|
+
```
|
18
|
+
|
19
|
+
## Building
|
20
|
+
|
21
|
+
To build the library, run:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
ng build add-calculator
|
25
|
+
```
|
26
|
+
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
28
|
+
|
29
|
+
### Publishing the Library
|
30
|
+
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
32
|
+
|
33
|
+
1. Navigate to the `dist` directory:
|
34
|
+
```bash
|
35
|
+
cd dist/add-calculator
|
36
|
+
```
|
37
|
+
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
39
|
+
```bash
|
40
|
+
npm publish
|
41
|
+
```
|
42
|
+
|
43
|
+
## Running unit tests
|
44
|
+
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
46
|
+
|
47
|
+
```bash
|
48
|
+
ng test
|
49
|
+
```
|
50
|
+
|
51
|
+
## Running end-to-end tests
|
52
|
+
|
53
|
+
For end-to-end (e2e) testing, run:
|
54
|
+
|
55
|
+
```bash
|
56
|
+
ng e2e
|
57
|
+
```
|
58
|
+
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
60
|
+
|
61
|
+
## Additional Resources
|
62
|
+
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
<p>add-calculator works!</p>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
2
|
+
|
3
|
+
import { AddCalculatorComponent } from './add-calculator.component';
|
4
|
+
|
5
|
+
describe('AddCalculatorComponent', () => {
|
6
|
+
let component: AddCalculatorComponent;
|
7
|
+
let fixture: ComponentFixture<AddCalculatorComponent>;
|
8
|
+
|
9
|
+
beforeEach(async () => {
|
10
|
+
await TestBed.configureTestingModule({
|
11
|
+
imports: [AddCalculatorComponent]
|
12
|
+
})
|
13
|
+
.compileComponents();
|
14
|
+
|
15
|
+
fixture = TestBed.createComponent(AddCalculatorComponent);
|
16
|
+
component = fixture.componentInstance;
|
17
|
+
fixture.detectChanges();
|
18
|
+
});
|
19
|
+
|
20
|
+
it('should create', () => {
|
21
|
+
expect(component).toBeTruthy();
|
22
|
+
});
|
23
|
+
});
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Component } from '@angular/core';
|
2
|
+
|
3
|
+
@Component({
|
4
|
+
selector: 'lib-add-calculator',
|
5
|
+
template: `
|
6
|
+
<div>
|
7
|
+
<input type="number" [(ngModel)]="num1" placeholder="Enter first number" />
|
8
|
+
<input type="number" [(ngModel)]="num2" placeholder="Enter second number" />
|
9
|
+
<button (click)="addNumbers()">Add</button>
|
10
|
+
<div *ngIf="result !== null">Result: {{ result }}</div>
|
11
|
+
</div>
|
12
|
+
`,
|
13
|
+
})
|
14
|
+
export class AddCalculatorComponent {
|
15
|
+
num1: number = 0;
|
16
|
+
num2: number = 0;
|
17
|
+
result: number | null = null;
|
18
|
+
|
19
|
+
addNumbers() {
|
20
|
+
this.result = this.num1 + this.num2;
|
21
|
+
}
|
22
|
+
}
|
package/ng-package.json
ADDED
package/package.json
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"name": "add-calculator-mdimran0509",
|
3
|
+
"version": "0.0.1",
|
4
|
+
"main": "bundles/add-calculator.umd.js",
|
5
|
+
"peerDependencies": {
|
6
|
+
"@angular/common": "^19.2.0",
|
7
|
+
"@angular/core": "^19.2.0"
|
8
|
+
},
|
9
|
+
"dependencies": {
|
10
|
+
"tslib": "^2.3.0"
|
11
|
+
},
|
12
|
+
"sideEffects": false
|
13
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
2
|
+
|
3
|
+
import { AddCalculatorComponent } from './add-calculator.component';
|
4
|
+
|
5
|
+
describe('AddCalculatorComponent', () => {
|
6
|
+
let component: AddCalculatorComponent;
|
7
|
+
let fixture: ComponentFixture<AddCalculatorComponent>;
|
8
|
+
|
9
|
+
beforeEach(async () => {
|
10
|
+
await TestBed.configureTestingModule({
|
11
|
+
imports: [AddCalculatorComponent]
|
12
|
+
})
|
13
|
+
.compileComponents();
|
14
|
+
|
15
|
+
fixture = TestBed.createComponent(AddCalculatorComponent);
|
16
|
+
component = fixture.componentInstance;
|
17
|
+
fixture.detectChanges();
|
18
|
+
});
|
19
|
+
|
20
|
+
it('should create', () => {
|
21
|
+
expect(component).toBeTruthy();
|
22
|
+
});
|
23
|
+
});
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { NgModule } from '@angular/core';
|
2
|
+
import { CommonModule } from '@angular/common';
|
3
|
+
import { FormsModule } from '@angular/forms';
|
4
|
+
import { AddCalculatorComponent } from './add-calculator.component';
|
5
|
+
|
6
|
+
@NgModule({
|
7
|
+
declarations: [AddCalculatorComponent],
|
8
|
+
imports: [CommonModule, FormsModule],
|
9
|
+
exports: [AddCalculatorComponent],
|
10
|
+
})
|
11
|
+
export class AddCalculatorModule {}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
2
|
+
|
3
|
+
import { AddCalculatorService } from './add-calculator.service';
|
4
|
+
|
5
|
+
describe('AddCalculatorService', () => {
|
6
|
+
let service: AddCalculatorService;
|
7
|
+
|
8
|
+
beforeEach(() => {
|
9
|
+
TestBed.configureTestingModule({});
|
10
|
+
service = TestBed.inject(AddCalculatorService);
|
11
|
+
});
|
12
|
+
|
13
|
+
it('should be created', () => {
|
14
|
+
expect(service).toBeTruthy();
|
15
|
+
});
|
16
|
+
});
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
3
|
+
{
|
4
|
+
"extends": "../../tsconfig.json",
|
5
|
+
"compilerOptions": {
|
6
|
+
"outDir": "../../out-tsc/lib",
|
7
|
+
"declaration": true,
|
8
|
+
"declarationMap": true,
|
9
|
+
"inlineSources": true,
|
10
|
+
"types": []
|
11
|
+
},
|
12
|
+
"exclude": [
|
13
|
+
"**/*.spec.ts"
|
14
|
+
]
|
15
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
3
|
+
{
|
4
|
+
"extends": "./tsconfig.lib.json",
|
5
|
+
"compilerOptions": {
|
6
|
+
"declarationMap": false
|
7
|
+
},
|
8
|
+
"angularCompilerOptions": {
|
9
|
+
"compilationMode": "partial"
|
10
|
+
}
|
11
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
3
|
+
{
|
4
|
+
"extends": "../../tsconfig.json",
|
5
|
+
"compilerOptions": {
|
6
|
+
"outDir": "../../out-tsc/spec",
|
7
|
+
"types": [
|
8
|
+
"jasmine"
|
9
|
+
]
|
10
|
+
},
|
11
|
+
"include": [
|
12
|
+
"**/*.spec.ts",
|
13
|
+
"**/*.d.ts"
|
14
|
+
]
|
15
|
+
}
|