I'm encountering an issue with my directive not working properly. I suspect that I may have registered it incorrectly, but I can't seem to figure out the mistake. Could it be related to the naming convention? Here's the code snippet in question -
My Directive -
'use strict';
angular.module('demoApp')
.directive('packeryAngular', ['$rootScope', '$timeout',
function($rootScope, $timeout) {
return {
restrict: 'A',
scope: true,
link: function(scope, element, attrs) {
};
}
]);
When using this directive on a div like so
<div packeryAngular>
However, nothing happens as expected. I thought registering it on my app might be the solution, like this:
angular.module('demoApp', [ 'packeryAngular ']
But doing so results in the following error in the console :
Error: [$injector:modulerr] Failed to instantiate module packeryAngular due to:
Error: [$injector:nomod] Module 'packeryAngular' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
As a newbie in this field, I'm struggling to find the root cause of the issue here. Despite trying to follow other examples closely, I haven't been successful. Any assistance would be greatly appreciated. Thank you for taking the time to read!