ensure form is there for validation
self.model.category.id = null;
self.model.category.systemName = null;
self.existingFeedNames = {};
+ if (self.defineFeedGeneralForm && self.defineFeedGeneralForm['feedName']) {
self.defineFeedGeneralForm['feedName'].$setValidity('notUnique', true);
}
}
+ }
function existingFeedNameKey(categoryId, feedName) {
return categoryId + "-" + feedName;
function _validate() {
//validate to ensure the name is unique in this category
if (self.model && self.model.category && self.existingFeedNames[existingFeedNameKey(self.model.category.id, self.model.systemFeedName)]) {
+ if (self.defineFeedGeneralForm && self.defineFeedGeneralForm['feedName']) {
self.defineFeedGeneralForm['feedName'].$setValidity('notUnique', false);
}
+ }
else {
+ if (self.defineFeedGeneralForm && self.defineFeedGeneralForm['feedName']) {
self.defineFeedGeneralForm['feedName'].$setValidity('notUnique', true);
}
}
+ }
if (_.isEmpty(self.existingFeedNames)) {
populateExistingFeedNames().then(function () {
