This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Description
I have a directive that creates inputs. Something like:
module.directive('ci', function() {
return {
scope: {
model: '=ciModel',
name: '@ciName',
validation: '@ciValidation'
},
template: '<input validate="{{validate}}" name="{{name}}" ng-model="{{model}}" />'
}
});
I use this in my form to generate inputs, like so:
<form name="userForm">
<div ci ci-name="website" ci-validation="url|required" ci-model="user.website"></div>
</form>
This causes errors when I try to validate in my controller, like so:
var isValid = new validationService().checkFormValidity($scope.startForm);
// ERROR: checkFormValidity() requires a valid Angular Form or $scope object passed as argument to function properly (ex.: $scope.form1 OR $scope).
If I include the inputs in my form without using the custom directive, the form validates properly.
I get why this happens... but is there a workaround for this? Or another best practice for this case?