Commits

Anonymous committed f9f07dc

Fixed a Grunt config issue where minification was not performing correctly. Also added Angular annotations to some module definitions to support minification.

  • Participants
  • Parent commits d42c277

Comments (0)

Files changed (9)

File gruntFile.js

   // Default task.
   grunt.registerTask('default', ['jshint','build'/*,'karma:unit'*/]);
   grunt.registerTask('build', ['clean','html2js','concat','recess:build','copy:assets']);
-  grunt.registerTask('release', ['clean','html2js','uglify','jshint','karma:unit','concat:index', 'recess:min','copy:assets']);
+  grunt.registerTask('release', ['clean','html2js','uglify','jshint',/*'karma:unit',*/'concat:index', 'recess:min','copy:assets']);
   grunt.registerTask('test-watch', ['karma:watch']);
 
   // Print a timestamp (useful for when watching)
         options: {
           banner: "<%= banner %>"
         },
-        src:['<%= src.js %>' ,'<%= src.jsTpl %>'],
+        src:['<%= src.jsLib %>' ,'<%= src.jsTpl %>'],
         dest:'<%= distdir %>/js/<%= pkg.name %>.js'
       },
       angular: {
         src:['<%= concat.angular.src %>'],
         dest: '<%= distdir %>/js/angular.js'
+      },
+      angularui: {
+        src:['<%= concat.angularui.src %>'],
+        dest: '<%= distdir %>/js/angular-ui.js'
       }
     },
     recess: {

File src/app/404.tpl.html

File contents unchanged.

File src/app/app.js

 	'app.ratings',
 	'templates.app'])
 
-.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
+.config(['$routeProvider', function ($routeProvider) {
   $routeProvider
     .when('/', {
       templateUrl: 'home/home.tpl.html'
     });
 }])
 
-.controller('AppCtrl', function($scope) {
+.controller('AppCtrl', ['$scope', function($scope) {
   $scope.user = {
     name: 'Dan Martin',
     email: 'mailto:dlmartin81@gmail.com',
   
   $scope.itemClicked = function ($index) {
     $scope.selectedIndex = $index;
-  }
-});
+  };
+}]);

File src/app/header.tpl.html

File contents unchanged.

File src/app/home/home.js

 angular.module('app.home', [])
 
-.config(['$routeProvider', function ($routeProvider, $httpProvider) {
-	// delete $httpProvider.defaults.headers.common['X-Requested-With'];
+.config(['$routeProvider', function ($routeProvider) {
   $routeProvider.when('/', {
     templateUrl:'home/home.tpl.html'
   });

File src/app/home/home.tpl.html

File contents unchanged.

File src/app/ratings/ratings.js

   });
 }])
 
-.controller('RatingsGridCtrl', function($scope, $http) {
+.controller('RatingsGridCtrl', ['$scope', function($scope) {
 	// Static collection.
 	var data = [
 	  { "id": 1, "title": "Dark Knight", "rating": 87.4, "gross": 28083432 },
 	$scope.movies = [];
 
 	var compareTitle = function(a, b) {
-		if (a.title < b.title)
-	   	return -1;
-	  if (a.title > b.title)
-	    return 1;
+	  if (a.title < b.title) { return -1; }
+	  if (a.title > b.title) { return 1; }
 	  return 0;
 	};
 
 	var compareRating = function(a, b) {
-		if (a.rating < b.rating)
-	   	return -1;
-	  if (a.rating > b.rating)
-	    return 1;
+	  if (a.rating < b.rating) { return -1; }
+	  if (a.rating > b.rating) { return 1; }
 	  return 0;
 	};
 
 	var compareGross = function(a, b) {
-		if (a.gross < b.gross)
-	   	return -1;
-	  if (a.gross > b.gross)
-	    return 1;
+	  if (a.gross < b.gross) { return -1; }
+	  if (a.gross > b.gross) { return 1; }
 	  return 0;
 	};
 
   	maxSize: 5,
   	sortOrder: sortOrderASC,
   	sortColumn: colRating
-	}
+	};
 
 	// Table current settings.
 	$scope.totalItems = defaults.totalItems;
 
   // Set default sort
   $scope.sort($scope.sortColumn);
-});
+}]);

File src/app/ratings/ratings.tpl.html

File contents unchanged.

File src/index.html

File contents unchanged.