formly-js/angular-formly-templates-ionic

the example is not working anymore

zippoB opened this issue · 3 comments

getting the following error:

Error: Formly Error: There is no type by the name of "input": {"key":"username","type":"input","templateOptions":{"type":"text","placeholder":"johndoe"},"data":{},"validation":{"messages":{}}}.
at getFormlyError (http://localhost:8100/lib/angular-formly/dist/formly.js:184:15)
at formlyConfig.getType (http://localhost:8100/lib/angular-formly/dist/formly.js:274:16)
at getFieldTemplate (http://localhost:8100/lib/angular-formly/dist/formly.js:877:32)
at fieldLink (http://localhost:8100/lib/angular-formly/dist/formly.js:840:10)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:16013:44
at invokeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:16019:9)
at nodeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:15531:11)
at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13)
at publicLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:14766:30)
at boundTranscludeFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:14905:16)

I have this in controller

    $scope.formData = {};
    $scope.formFields = [{
        //the key to be used in the model values {... "username": "johndoe" ... }
        key: 'username',
        type: 'input',
        templateOptions: {
            type: 'text',
            placeholder: 'johndoe'
        }
    }, {
        key: 'password',
        type: 'input',
        templateOptions: {
            type: 'password',
            placeholder: 'Password'
        }
    }, {
        key: 'remember',
        type: 'range',
        templateOptions: {
            //label: 'Password',
            rangeClass: 'calm',
            min: '0',
            max: '100',
            step: '5',
            value: '25',
            minIcon:'ion-volume-low',
            maxIcon:'ion-volume-high'
        }
    }

and this in app.js

angular.module('starter', ['ionic', 'formly','formlyIonic','starter.controllers'])

Tried updating formly and formlyIonic to the latest version, but didn't help.

Any feedback appreciated.

Thanks

Hmm, alright. Will check this out

Mike Hartington

On Apr 16, 2015, at 6:13 PM, zippoB notifications@github.com wrote:

getting the following error:

Error: Formly Error: There is no type by the name of "input": {"key":"username","type":"input","templateOptions":{"type":"text","placeholder":"johndoe"},"data":{},"validation":{"messages":{}}}.
at getFormlyError (http://localhost:8100/lib/angular-formly/dist/formly.js:184:15)
at formlyConfig.getType (http://localhost:8100/lib/angular-formly/dist/formly.js:274:16)
at getFieldTemplate (http://localhost:8100/lib/angular-formly/dist/formly.js:877:32)
at fieldLink (http://localhost:8100/lib/angular-formly/dist/formly.js:840:10)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:16013:44
at invokeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:16019:9)
at nodeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:15531:11)
at compositeLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13)
at publicLinkFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:14766:30)
at boundTranscludeFn (http://localhost:8100/lib/ionic/js/ionic.bundle.js:14905:16)

I have this in controller

$scope.formData = {};
$scope.formFields = [{
    //the key to be used in the model values {... "username": "johndoe" ... }
    key: 'username',
    type: 'input',
    templateOptions: {
        type: 'text',
        placeholder: 'johndoe'
    }
}, {
    key: 'password',
    type: 'input',
    templateOptions: {
        type: 'password',
        placeholder: 'Password'
    }
}, {
    key: 'remember',
    type: 'range',
    templateOptions: {
        //label: 'Password',
        rangeClass: 'calm',
        min: '0',
        max: '100',
        step: '5',
        value: '25',
        minIcon:'ion-volume-low',
        maxIcon:'ion-volume-high'
    }
}

and this in app.js

angular.module('starter', ['ionic', 'formly','formlyIonic','starter.controllers'])

Tried updating formly and formlyIonic to the latest version, but didn't help.

Any feedback appreciated.

Thanks


Reply to this email directly or view it on GitHub.

ok, it seems like angular-formly-templates-ionic.js that gets installed with

$ bower install api-check angular-formly angular-formly-templates-ionic --save

has an issue. If I replace that with https://github.com/formly-js/angular-formly-templates-ionic/blob/master/dist/angular-formly-templates-ionic.js, it works fine.

Weird, alright, I just pushed a new release of the code in the repo so bower should get the update soon.