example of navigation

This commit is contained in:
tykayn 2019-08-10 16:21:12 +02:00
parent 42f229f686
commit 46cce96dab
4 changed files with 114 additions and 0 deletions

View 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>

View File

View 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();
});
});

View 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;
}
}