P
P
Pogran2016-12-27 11:48:58
Angular
Pogran, 2016-12-27 11:48:58

How to load a model into a reactive form?

I have a form like this in the constructor

this.lineForm = fb.group({
            campaignType: [null, Validators.required],
            name: [null],
            state: [null, Validators.required],
            startDate: [this.getDate(this.startDate), Validators.required],
            endDate: [this.getDate(this.endDate), Validators.required],
            impression: [null, Validators.required],
            mediaCost: [null, Validators.required],
            partyInventory: ['active', Validators.required],
            perImpression: ['active', Validators.required],
            cpm: [null],
        });

I want to load all the model in this form at once in this method
onOpenModalEdit(item) 
{
 // item - это и есть модель с данными
}

Is there a load method on a reactive form? otherwise it’s somehow not very good to load one field by setting the value through setValue

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Flur, 2017-05-29
@aslanovich

Well, it was made using css, namely through transform: matrix3d ​​( use )
+ Scroll is hung on the "cursor movement" event. Those. the page is conditionally divided (horizontally) into 2 parts and when the cursor moves away from the center of the image, the images scroll at a higher speed in a certain direction

A
Alexander Lysenko, 2017-05-29
@AlexanderZe

Is it a script? It seems to me that everything is implemented through 3D transformations using CSS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question