question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sorting problem after grunt build

See original GitHub issue

Sorting wont work after ‘grunt build’, I assume it is the js-minify that somehow breaks it. Nothing happens when I click a header. Strange though that everything else works. Anyone with similar problems?

Here’s my directive controller

controller: ['$scope', '$filter', 'ScoresAPI', 'ngTableParams', function($scope, $filter, ScoresAPI, ngTableParams)
{
    ScoresAPI.getLeagueStandings($scope.leagueId)
        .success(function(data)
        {
            $scope.tableParams = new ngTableParams({
                page: 1,
                count: data.length,
                sorting: false
            }, {
                total: data.length,
                counts: [],
                getData: function($defer, params)
                {
                    var orderedData = params.sorting() ? $filter('orderBy')(data, params.orderBy()) : data;
                    $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
                }
            });
        });
}]

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:29

github_iconTop GitHub Comments

6reactions
faisalferozcommented, Mar 13, 2014

In my case it wasn’t the jsminify target. But was the htmlmin target. I changed collapseBooleanAttributes to false and it solved the issue for me. Here is the whole configuration of the target:

htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          collapseBooleanAttributes: false,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['*.html', 'views/{,*/}*.html', 'app_components/{,**/}*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    }
1reaction
avandecremecommented, Aug 4, 2015

Both solutions worked for me. However I was having a CSS issue as well (see the 2 up arrows on not sorted columns): ng-table-css-min

Setting the following option fixed the issue:

        cssmin: {
            options: {
                advanced: false
            }
        },


Read more comments on GitHub >

github_iconTop Results From Across the Web

angularjs code is not working after grunt build - Stack Overflow
using grunt --force command to build. When I run the build it does not show any errors in console and under netowek tab...
Read more >
Problem capturing error output · Issue #117 · gruntjs/grunt
I have a Windows 2008 R2 server x86 (on EC2) as a Jenkins server. All of our builds are kicked off with Powershell....
Read more >
Grunt tool window | WebStorm Documentation - JetBrains
on the toolbar, choose Sort by from the menu, and then choose Name. By default, a tree shows the tasks in the order...
Read more >
A Beginner's Guide To Grunt: Build Tool for JavaScript
The free course about grunt basics and walked through the process of creating a build script for a small web application.
Read more >
grunt-sort-json - npm
grunt -sort-json Build Status. A grunt task for alphabetizing JSON files. Community. If you have any problems setting up or using grunt-sort ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found