2017-09-22 12:26:08 +02:00
< form [ formGroup ] = " myForm " >
2017-12-20 15:26:30 +01:00
< div class = "form-group" [ ngClass ] = " { ' has-error ' : ! myForm . controls . route . valid & & myForm . controls . route . dirty } " >
2017-09-22 12:26:08 +02:00
< label for = "pageRouteTag" > Page Route< / label >
< input type = "text" class = "form-control" formControlName = "route" id = "pageRouteTag" placeholder = "Page Route" >
< / div >
< div class = "form-group" [ ngClass ] = " { ' has-error ' : ! myForm . controls . name . valid & & myForm . controls . name . dirty } " >
< label for = "pageNameTag" > Page Name< / label >
< input type = "text" class = "form-control" formControlName = "name" id = "pageNameTag" placeholder = "Page Name" >
< / div >
2017-12-20 15:26:30 +01:00
< div * ngIf = "!type" class = "form-group" [ ngClass ] = " { ' has-error ' : ! myForm . controls . type . valid & & myForm . controls . type . dirty } " >
< label for = "typeTag" > Select Type< / label >
< select formControlName = "type" id = "typeTag" class = "form-control" >
< option [ value ] = " ' search ' " > search< / option >
< option [ value ] = " ' link ' " > link< / option >
< option [ value ] = " ' share ' " > share< / option >
< / select >
< / div >
2017-12-13 12:15:19 +01:00
2018-01-04 16:56:22 +01:00
< div formArrayName = "entities" class = "form-group" >
< label for = "entityNameTag" > Entity Name< / label >
< div id = "entityNameTag" >
< pre class = "card card-block card-header" > < span * ngFor = "let entity of myForm.value.entities; let i=index" > {{entity.name}}< span * ngIf = "i<(myForm.value.entities.length-1)" > , < / span > < / span > < / pre >
< button type = "button" ( click ) = " toggle ( ) " > Add / Remove entities< / button >
< ng-container * ngIf = "!myForm.value.isCollapsed" >
< div * ngFor = "let entity of getKeys(allEntities)" >
< span >
< span * ngIf = "allEntities.get(entity)" class = "activated" >
< input ( click ) = " toggleEntity ( false , [ entity . _id ] , entity ) " class = "deactivate" src = "imgs/delete-icon.png" title = "Disable" width = "20" type = "image" height = "20" >
< / span >
< span * ngIf = "!allEntities.get(entity)" class = "deactivated" >
< input ( click ) = " toggleEntity ( true , [ entity . _id ] , entity ) " class = "deactivate" src = "imgs/add-icon.png" title = "Enable" width = "20" type = "image" height = "20" >
< / span >
{{entity.name}}
< / span >
< / div >
< / ng-container >
< / div >
2017-12-13 12:15:19 +01:00
< / div >
2017-09-22 12:26:08 +02:00
< input type = "hidden" formControlName = "_id" >
< / form >