I am developing a website using angularjs and am using npm to host a local development server.
I copied my project directory into a public AFS directory and can access the index.html page fine but the npm dependencies arent working. (I am getting the same errors as if I would open my index.html file locally without running "npm start") Specifically, the error happens in a custom validation I created.
angular.module('myApp').directive('customValidator', function() {
return {
require: 'ngModel',
link: function($scope, element, attrs, ngModel) {
ngModel.$validators.validInput = function(value) {
-------custom validation-----------
return isValid;
};
}
}
});
Here it says ngModel does not have a $validators property and therefore I am assigning a value of 'validInput' to undefined, which results in the error.
How can I run my project in this new distributed file system if I can't call npm start on the production directory??
Do I have to create different environments in my app.js? Not really sure what that even means...