forked from tykayn/funky-framadate-front
⚡ example of navigation
This commit is contained in:
parent
42f229f686
commit
46cce96dab
63
src/app/debugger/debugger.component.html
Normal file
63
src/app/debugger/debugger.component.html
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<div class="well debug">
|
||||||
|
|
||||||
|
<strong>
|
||||||
|
|
||||||
|
<h2 i18n>
|
||||||
|
infos de debug
|
||||||
|
</h2>
|
||||||
|
</strong>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
étape actuelle {{config.step}} / {{config.stepMax}}
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
formulaire valide : {{formIsValid}}
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
type de formulaire: {{config.pollType}}
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
config:
|
||||||
|
<pre>
|
||||||
|
{{config|json}}
|
||||||
|
</pre>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span i18n>
|
||||||
|
Choix cornélien syncronisé:
|
||||||
|
</span>
|
||||||
|
<!-- todo: factoriser les boutons-->
|
||||||
|
<button
|
||||||
|
(click)="config.set('pollType' , 'classic')"
|
||||||
|
[class.active]="config.pollType == 'classic'"
|
||||||
|
[disabled]="!formIsValid"
|
||||||
|
class="btn btn-primary next"
|
||||||
|
>
|
||||||
|
<span i18n>
|
||||||
|
sondage classique
|
||||||
|
</span>
|
||||||
|
<span *ngIf="config.pollType == 'classic'">
|
||||||
|
[x]
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
(click)="selectOption('pollType' ,'dates')"
|
||||||
|
[class.active]="config.pollType == 'dates'"
|
||||||
|
[disabled]="!formIsValid"
|
||||||
|
class="btn btn-primary next"
|
||||||
|
>
|
||||||
|
<span i18n>
|
||||||
|
sondage spécial date
|
||||||
|
</span>
|
||||||
|
<span *ngIf="config.pollType == 'dates'">
|
||||||
|
[x]
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button class="btn" i18n (click)="config.sendForm()">
|
||||||
|
Envoyer le formulaire
|
||||||
|
</button>
|
0
src/app/debugger/debugger.component.scss
Normal file
0
src/app/debugger/debugger.component.scss
Normal file
25
src/app/debugger/debugger.component.spec.ts
Normal file
25
src/app/debugger/debugger.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { DebuggerComponent } from './debugger.component';
|
||||||
|
|
||||||
|
describe('DebuggerComponent', () => {
|
||||||
|
let component: DebuggerComponent;
|
||||||
|
let fixture: ComponentFixture<DebuggerComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ DebuggerComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(DebuggerComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
26
src/app/debugger/debugger.component.ts
Normal file
26
src/app/debugger/debugger.component.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import {Component, OnInit} from '@angular/core';
|
||||||
|
import {ConfigService} from '../config.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'framadate-debugger',
|
||||||
|
templateUrl: './debugger.component.html',
|
||||||
|
styleUrls: ['./debugger.component.scss']
|
||||||
|
})
|
||||||
|
export class DebuggerComponent implements OnInit {
|
||||||
|
private formIsValid = true;
|
||||||
|
|
||||||
|
constructor(private config: ConfigService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
selectOption(key: string, val: any) {
|
||||||
|
if (!this.config[key]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.config[key] = val;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user