0
On my main page shows me the error: Uncaught ReferenceError: Insidetv is not defined
, i.e., the Controller is not finding the file of Model. But if I put the two in the same file works perfectly.
On the main page first is calling the Model and then the Controller and both pages are being found.
Model
var Insidetv = angular.module('Insidetv', []);
Insidetv.config(function($interpolateProvider){
$interpolateProvider.startSymbol('[{');
$interpolateProvider.endSymbol('}]');
});
Controller
Insidetv.controller('ListaController', function($scope, $http) {
$scope.dragStop = function(e, ui) {
console.log('ok');
}
$('.drop').sortable({
connectWith: "ul",
revert: true,
appendTo: '.lista',
helper: 'clone',
stop: $scope.dragStop
});
});
If you are putting the module in one file and the controller in another you need to set the controller inside a new module, because the two are loaded at the same time and the order doesn’t matter.
– Rômulo Gabriel Rodrigues