Everything is working but when I try to separate my script to external js files, AngularJS is not running.
Here is my script:
<script>
angular.module('MyApp', ['ngMaterial', 'ngMessages', 'material.svgAssetsCache'])
.controller('AppCtrl', function ($scope) {
$scope.isDisabled = true;
$scope.UnitReport = function(){
alert("aa");
}
})
//this is just a part of script
;
</script>
I separated like:
.controller('AppCtrl', function ($scope) {
$scope.UnitReport = function(){
alert("aa");
}
})
but didn't work.
Also, I separated like:
angular.module('MyApp', ['ngMaterial', 'ngMessages', 'material.svgAssetsCache'])
.controller('AppCtrl', function ($scope) {
$scope.UnitReport = function(){
alert("aa");
}
})
but didn't work again.
How is possible to separate this AngularJS?
P.S.: There aren't any mistakes on the external file link and functions.