AngularJS directive which takes JSON representing a form and renders to HTML
Hi,
I made a custom field type so I could use Angular Material 2 templates and some custom stuff perhaps
So this is what I made
import { FieldType } from 'ng-formly';
import { Component } from '@angular/core';
@Component({
template: `
<md-input-container>
<input mdInput [type]="to.type" *ngIf="!to.hidden" [formlyAttributes]="field" [placeholder]="to.placeholder" [formControl]="formControl"
[min]="to.minLength" [max]="to.maxLength" [min]="to.min" [max]="to.max" [pattern]="to.pattern" />
</md-input-container>
`
})
export class InputComponent extends FieldType { }
I registered this in my module as:
FormlyModule.forChild({
types: [
{ name: 'input', component: InputComponent },
{ name: 'date', component: DateComponent }
]
}),
this does work, but when I create a field with a key and I have a model with the same key and a value, it doesn't show as the value of the input
Looking for some pointers on how to get formly to work well with the translate (formly-js/angular-formly#373)
I can't seem to get the radio labels to translate in this example - https://jsbin.com/tuniqe/2/edit?html,js,output
Hey Guys, I need to add a css class to div element containing a fieldGroup form. any suggestion how to do that?
Whatever className I provide to fieldGroup, It gets added correctly and as expected to form element, But for adding a css class to the parent div, I am not able to figure it out.
For e.g.
fields = [
{
className: 'row',
fieldGroup: [...]
}
]
Gives me this:
<div formly-field="" class="formly-field ng-scope ng-isolate-scope formly-field-group" ...>
<ng-form class="row formly ng-pristine ng-valid ng-scope ng-isolate-scope" ...>
</ng-form></div>
What I need is :
<div formly-field="" class=" MY_ROW_CONTAINER_CLASS formly-field ng-scope ng-isolate-scope formly-field-group" ...>
<ng-form class="row formly ng-pristine ng-valid ng-scope ng-isolate-scope" ...>
</ng-form></div>
Please help. Thanks
Hey Guys, I need to add a css class to div element containing a fieldGroup form. any suggestion how to do that?
Whatever className I provide to fieldGroup, It gets added correctly and as expected to form element, But for adding a css class to the parent div, I am not able to figure it out.
For e.g.
fields = [
{
className: 'row',
fieldGroup: [...]
}
]
Gives me this:
<div formly-field="" class="formly-field ng-scope ng-isolate-scope formly-field-group" ...>
<ng-form class="row formly ng-pristine ng-valid ng-scope ng-isolate-scope" ...>
</ng-form>
</div>
What I need is :
<div formly-field="" class=" MY_ROW_CONTAINER_CLASS formly-field ng-scope ng-isolate-scope formly-field-group" ...>
<ng-form class="row formly ng-pristine ng-valid ng-scope ng-isolate-scope" ...>
</ng-form>
</div>
Please help!
In templateOptions
notNull: true
definitely works if you're using the bootstrap templates Bootstrap templates