What\'s going on here?
Here is my directive:
app.directive(\'submitRequired\', function (objSvc) {
return {
require: \'ngModel\',
You can also remove the line
require: 'ngModel',
if you don't need ngModel in this directive. Removing ngModel will allow you to make a directive without thatngModel error.
I faced the same error, in my case I miss-spelled ng-model directive something like "ng-moel"
Wrong one: ng-moel="user.name" Right one: ng-model="user.name"
As described here: Angular NgModelController, you should provide the <input with the required controller ngModel
<input submit-required="true" ng-model="user.Name"></input>
One possible solution to this issue is ng-model attribute is required to use that directive.
Hence adding in the 'ng-model' attribute can resolve the issue.
<input submit-required="true" ng-model="user.Name"></input>