Skip to content
Snippets Groups Projects
Commit 200bf5be authored by Martin Immanuel Burgos's avatar Martin Immanuel Burgos
Browse files

Merge branch '3-frontend-annonser-form' into 'master'

Resolve "Frontend: Annonser form"

Closes #3

See merge request !3
parents 1d6befb4 a177dac9
Branches feature/update-gitignore
No related tags found
No related merge requests found
Showing with 209 additions and 1 deletion
import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
selector: 'app-number-input',
templateUrl: './number-input.component.html',
styleUrls: ['./number-input.component.scss']
})
export class NumberInputComponent {
@Input()
label: string = "";
@Input()
inputModel: number;
@Input()
placeholder: string = "";
@Output()
inputModelChange = new EventEmitter<number>();
@Output()
change = new EventEmitter();
@Output()
focus = new EventEmitter();
@Output()
blur = new EventEmitter();
constructor() { }
}
<label>
{{label}}
<select
[(ngModel)]="inputModel"
(ngModelChange)="inputModelChange.emit($event)"
(change)="change.emit($event)"
(focus)="focus.emit($event)"
(blur)="blur.emit($event)">
<ng-content></ng-content>
</select>
</label>
\ No newline at end of file
select{
padding: 5px;
}
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SelectComponent } from './select.component';
describe('SelectComponent', () => {
let component: SelectComponent;
let fixture: ComponentFixture<SelectComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ SelectComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(SelectComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
selector: 'app-select',
templateUrl: './select.component.html',
styleUrls: ['./select.component.scss']
})
export class SelectComponent {
@Input()
label: string = "";
@Input()
inputModel: any;
@Input()
placeholder: string = "";
@Output()
inputModelChange = new EventEmitter<any>();
@Output()
change = new EventEmitter();
@Output()
focus = new EventEmitter();
@Output()
blur = new EventEmitter();
constructor() { }
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TextInputComponent } from './text-input/text-input.component';
import { FormsModule } from '@angular/forms';
import { NumberInputComponent } from './number-input/number-input.component';
import { ButtonComponent } from './button/button.component';
import { SelectComponent } from './select/select.component';
@NgModule({
declarations: [
TextInputComponent,
NumberInputComponent,
ButtonComponent,
SelectComponent
],
exports: [
TextInputComponent,
NumberInputComponent,
ButtonComponent,
SelectComponent
],
imports: [
CommonModule,
FormsModule
]
})
export class SharedModule { }
<label>
{{label}}
<input
type="text"
[placeholder]="placeholder"
[(ngModel)]="inputModel"
(ngModelChange)="inputModelChange.emit(inputModel)"
(change)="change.emit($event)"
(focus)="focus.emit($event)"
(blur)="blur.emit($event)">
</label>
\ No newline at end of file
input{
padding: 5px;
}
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TextInputComponent } from './text-input.component';
describe('TextInputComponent', () => {
let component: TextInputComponent;
let fixture: ComponentFixture<TextInputComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ TextInputComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(TextInputComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
selector: 'app-text-input',
templateUrl: './text-input.component.html',
styleUrls: ['./text-input.component.scss']
})
export class TextInputComponent {
@Input()
label: string = "";
@Input()
inputModel: string;
@Input()
placeholder: string = "";
@Output()
inputModelChange = new EventEmitter<string>();
@Output()
change = new EventEmitter();
@Output()
focus = new EventEmitter();
@Output()
blur = new EventEmitter();
constructor() { }
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"baseUrl": "./", "baseUrl": "./",
"outDir": "./dist/out-tsc", "outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"strict": true, "strict": false,
"noImplicitReturns": true, "noImplicitReturns": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"sourceMap": true, "sourceMap": true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment