I utilized grunt
along with usemin
to merge and compress the following code:
<!-- build:js /assets/vendor.js -->
<script src="../public/bower_components/angular/angular.min.js"></script>
<script src="../public/bower_components/angular-route/angular-route.min.js"></script>
<!-- endbuild -->
This operation resulted in a consolidated file named vendor.js
. Additionally, I have an app.js
script that appears as follows:
(function() {
'use strict';
var myApp;
myApp = angular('myApp', ['ngRoute']);
myApp.config([
"$routeProvider", "$translateProvider", "$locationProvider", function($routeProvider, $translateProvider, $locationProvider) {
$routeProvider.when("/login", {
templateUrl: "/templates/login.html"
}).otherwise({
redirectTo: "/login"
});
return $locationProvider.html5Mode(true);
}
]);
}).call(this);
However, upon running it, an error message stating angular is not a function
is displayed. Provided below is the link to access the compressed and merged angular
scripts: https://gist.github.com/shamoons/b41855b7bd3acb94325d