formly-js/angular-formly-templates-material

Error Messages doesn't work inside modal belonging to tile button

Open

#38 opened on May 23, 2016

View on GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (38 forks)github user discovery
help wanted

Repository metrics

Stars
 (55 stars)
PR merge metrics
 (PR metrics pending)

Description

Hi guys.

I try to add error messages on my app but the red animation error doesn't work . Indeed, it work when I make a simple example like : http://jsbin.com/rexuquqeta/edit?js,console,output

  • Basically, I have a page that displays a grid on which I use a ng-repeat .

  • Inside each " tile " I dynamically displays data as text .

  • Each " tile " is a button that opens a modal .

  • When I click on a " tile " , so I open a modal which displays editable data as " input " .

  • Except that my problem is that the error messages do not fontionnent with my current structure .

  • Here is an overview :

        vm.tiles = [
            /* State */
            {
                span: {row: 2, col: 1},
                background: 'yellow',
                title: 'State',
                model: {
                    state: vm.details.state,
                    name: vm.details.name,
                    description: vm.details.description
                },
                fields: [
                    {
                        key: 'state',
                        type: 'detailsCenter',
                        templateOptions: {}
                    },
                    {
                        key: 'name',
                        type: 'details',
                        templateOptions: {
                            label: 'Name : '
                        }
                    },
                    {
                        key: 'description',
                        type: 'details2lines',
                        templateOptions: {
                            label: 'Description : '
                        }
                    }
                ],
                fieldsModal: [
                    {
                        elementAttributes: {
                            layout: 'row',
                            'layout-sm': 'column',
                            'layout-xs': 'column'
                        },
                        fieldGroup: [
                            {
                                key: 'state',
                                type: 'detailsCenter',
                                templateOptions: {}
                            }
                        ]
                    },
                    {
                        elementAttributes: {
                            layout: 'row',
                            'layout-sm': 'column',
                            'layout-xs': 'column'
                        },
                        fieldGroup: [
                            {
                                key: 'name',
                                className: 'flex-xs-100 flex-sm-100 flex-100',
                                type: 'input',
                                templateOptions: {label: 'Name : ', 'required': true}
                            },
                            {
                                key: 'description',
                                className: 'flex-xs-100 flex-sm-100 flex-100',
                                type: 'input',
                                templateOptions: {label: 'Description : ', 'required': true}
                            }
                        ]
                    }
                ]
            }, ...
    

If you have an idea what it could be ?

Nb: if you want more informations, say it to me .. thanks a lot for your help

Contributor guide