mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
patch default form values from loaded poll #105
This commit is contained in:
parent
a99290186c
commit
4fefa3340c
@ -101,6 +101,10 @@ export class FormComponent implements OnInit {
|
||||
});
|
||||
console.log('this.form ', this.form);
|
||||
|
||||
// take back values from pollservice
|
||||
this.form.patchValue(this.pollService.poll);
|
||||
this.form.patchValue({ creatorPseudo: 'Chuck Norris', creatorEmail: 'chucknorris@example.com' });
|
||||
|
||||
if (showDemoValues) {
|
||||
this.setDemoValues();
|
||||
this.toastService.display('default values filled for demo');
|
||||
@ -116,6 +120,10 @@ export class FormComponent implements OnInit {
|
||||
*/
|
||||
setDemoValues(): void {
|
||||
const title = 'le titre de démo oh oh ' + new Date().getTime();
|
||||
|
||||
// this.form.patchValue(this.pollService.poll);
|
||||
// this.form.patchValue({ creatorPseudo: 'Chuck Norris', creatorEmail: 'chucknorris@example.com' });
|
||||
|
||||
this.form.patchValue({
|
||||
title: title,
|
||||
custom_url: this.pollUtilitiesService.makeSlugFromString(title),
|
||||
@ -142,14 +150,6 @@ export class FormComponent implements OnInit {
|
||||
startDateInterval: new Date(),
|
||||
endDateInterval: new Date(),
|
||||
comments: [],
|
||||
// choices: [
|
||||
// {
|
||||
// name: 'un choix',
|
||||
// url: 'https://placekitten.com/120/150',
|
||||
// },
|
||||
// ],
|
||||
// dateChoices: defaultDates,
|
||||
// timeChoices: defaultTimeOfDay,
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user