uebung-6
This commit is contained in:
0
demo/src/app/create-auto/create-auto.component.css
Normal file
0
demo/src/app/create-auto/create-auto.component.css
Normal file
3
demo/src/app/create-auto/create-auto.component.html
Normal file
3
demo/src/app/create-auto/create-auto.component.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<p>create-auto works!</p>
|
||||
|
||||
<button (click)="createAuto">Auto erstellen</button>
|
||||
23
demo/src/app/create-auto/create-auto.component.spec.ts
Normal file
23
demo/src/app/create-auto/create-auto.component.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CreateAutoComponent } from './create-auto.component';
|
||||
|
||||
describe('CreateAutoComponent', () => {
|
||||
let component: CreateAutoComponent;
|
||||
let fixture: ComponentFixture<CreateAutoComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CreateAutoComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(CreateAutoComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
21
demo/src/app/create-auto/create-auto.component.ts
Normal file
21
demo/src/app/create-auto/create-auto.component.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Component, Output, EventEmitter } from '@angular/core';
|
||||
import { Auto } from '../Auto';
|
||||
|
||||
@Component({
|
||||
selector: 'app-create-auto',
|
||||
imports: [],
|
||||
templateUrl: './create-auto.component.html',
|
||||
styleUrl: './create-auto.component.css'
|
||||
})
|
||||
export class CreateAutoComponent {
|
||||
constructor(
|
||||
@Output() public autoInitializedEvent: EventEmitter<Auto>
|
||||
) {
|
||||
autoInitializedEvent = new EventEmitter<Auto>();
|
||||
}
|
||||
|
||||
createAuto() {
|
||||
var auto = new Auto("BMW", "e36", "DE-gho-st");
|
||||
this.autoInitializedEvent.emit(auto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user