I have an Angular directive element nested inside a controller, and I get this message
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. WARNING: Tried to load angular more than once.
I kinda understand what it means, but I don't know what is causing this issue. Here's what I have:
audio.html
<div class="audio-top-bar" ng-controller="AudioController">
<div class="audio-tuner-button" ng-click="displayTunerModal()">
<button class="btn">
<p class="audio-tuner-type">{{tunerButton}}</p>
</button>
</div>
<display-tuner-modal ng-show="visibility"></display-tuner-modal>
</div>
AudioController.js
angular.module('app').controller('AudioController', ['$scope', 'TunerService', function($scope, TunerService){
$scope.visibility = false;
if ($scope.tunerButton == (null || undefined))
$scope.tunerButton = 'FM';
$scope.displayTunerModal = function(){
$scope.visibility = true;
};
}]);
displayTunerModal.js
angular.module('app').directive('displayTunerModal', ['TunerService' , function (TunerService){
return {
restrict: 'E',
link: function(scope, elem, attrs){
scope.displayTunerModal = function(){
console.log("CLICKED");
};
},
templateUrl: 'public/templates/displayScreenModal.html'
};
}]);