Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

any known issues with UI-Router? #79

Closed
ohNegative opened this issue Jun 2, 2015 · 3 comments
Closed

any known issues with UI-Router? #79

ohNegative opened this issue Jun 2, 2015 · 3 comments

Comments

@ohNegative
Copy link

Hey guys,

I'm trying to use this and I have a pretty complicated setup. I'm using ui-router and trNgGrid alongside your plugin Valdr. I'm also using partials (or partial views) for the pages and have created a single main template (index.html) and I'm running into issues getting the form validation to work correctly. I'm not getting any errors in the console, but its not working right now.

Here is the partial for the "Search" page. I'm just trying to get one field to validate before I move on to the rest of the fields:

<form class="form-inline" id="basicSearch" name="userForm" valdr-type="claim">
       <div class="form-group">
           <label for="claimId">Claim ID</label>
           <input type="number" name="claimID" class="form-control" id="claimId" placeholder="Claim ID" ng-model="claimID" required>  
        </div>
</form>

Here is the app.js file:

var routerApp = angular.module('routerApp', ['ui.router', 'trNgGrid', 'valdr', ]);

routerApp.config(function($stateProvider, $urlRouterProvider) {

$urlRouterProvider.otherwise('/home');

$stateProvider
    .state('home', {
        url: '/home',
        templateUrl: 'global/partials/home.html'
    })
    .state('search', {
        url: '/search',
        templateUrl: 'search/partials/search.html'
    })
    .state('intake', {
        url: '/intake',
        templateUrl: 'intake/partials/intake.html'
    })
});

routerApp.config(function(valdrProvider) {
  valdrProvider.addConstraints({
    'Claim': {
      'claimID': {
        'size': {
          'min': 8,
            'max': 10,
          'message': 'The Claim ID is 10 numbers long.'
        },
        'required': {
          'message': 'Claim ID is required.'
        }
      },
    }
});

});

Since I'm not getting any errors in the console, I figure I'm pretty close to getting this to work. Let me know if you need anymore information.

Thanks in advance.

Pete

@bjorndown
Copy link

I am pretty sure the constraint names are case-sensitive, so I would give it a go with valdr-type="Claim", see if that helps.

@marcelstoer
Copy link
Collaborator

Great you find valdr useful!

I am pretty sure the constraint names are case-sensitive

Yes, they are. And please don't use this issue list for support requests: https://github.com/netceteragroup/valdr#support

@ohNegative
Copy link
Author

closing and moving issue to the support link you posted.

P

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants