Coder Social home page Coder Social logo

Comments (18)

volmerf avatar volmerf commented on July 30, 2024 1

We also agree with @webpartisan that there is no 2-way binding currently. Switching the language of the website will not switch the language of the mdLabel. Only on refreshing the page the translation is triggered.

This is our code:

vm.updateTranslations();
$rootScope.$on('$translateChangeSuccess', updateTranslations);

function updateTranslations(event) {

            $translate(['GENERAL.PAGINATION.PAGE', 'GENERAL.PAGINATION.ROWS_PER_PAGE', 'GENERAL.PAGINATION.OF']).then(function (translations) {
                vm.paginationLabel.page = translations['GENERAL.PAGINATION.PAGE'];
                vm.paginationLabel.rowsPerPage = translations['GENERAL.PAGINATION.ROWS_PER_PAGE'];
                vm.paginationLabel.of = translations['GENERAL.PAGINATION.OF'];
            });
        }

Changing the language will trigger the updateTranslations function but will not update the label.

from md-data-table.

daniel-nagy avatar daniel-nagy commented on July 30, 2024

This is a valid point. I'll try to fit this in to the next release.

from md-data-table.

daniel-nagy avatar daniel-nagy commented on July 30, 2024

resolved in version 0.4.6 :)

from md-data-table.

Fardinak avatar Fardinak commented on July 30, 2024

That looks good; although, I believe that it should extend to the of as well! i.e. "x - y of n"

from md-data-table.

shivasingh0101 avatar shivasingh0101 commented on July 30, 2024

Failed to load template: templates.md-data-table-progress.html...
i am getting this error message and also rest of the templates are not being loaded in the local server.

from md-data-table.

daniel-nagy avatar daniel-nagy commented on July 30, 2024

@shivasingh0101 that's strange, what version of Angular are you using?

from md-data-table.

shivasingh0101 avatar shivasingh0101 commented on July 30, 2024

@daniel-nagy angular 1.4.0

from md-data-table.

shivasingh0101 avatar shivasingh0101 commented on July 30, 2024

image

This is the error showing on my browser...

from md-data-table.

daniel-nagy avatar daniel-nagy commented on July 30, 2024

Either they are not being loaded into the template cache or the template cache is somehow getting emptied?

from md-data-table.

shivasingh0101 avatar shivasingh0101 commented on July 30, 2024

Is there any issue with webpack coz we are using webpack to build our app....

from md-data-table.

shivasingh0101 avatar shivasingh0101 commented on July 30, 2024

And one more thing it worked when i loaded the js and css files into my main js file but still the pagination is not working i mean its redirecting to the next page when i pressed next button but data is not rebinding i tried rebinding the data its showing in the console but not onto the page.

error_image2

from md-data-table.

Fardinak avatar Fardinak commented on July 30, 2024

Is having a page number against the guidelines?
If not so, you could provide variables like $start, $end, $count, $total, $page, $totalPages (like $index, $first, $last, etc. in ngRepeat) so the developer can format their own label like this:

<md-data-table-pagination md-label="$start - $end of $total (page $page of $totalPages)">

That gives away some flexibility of representation; page numbers are more useful in most cases!

IMO, it would look way better than the current API anyway! 😜

from md-data-table.

Fardinak avatar Fardinak commented on July 30, 2024

@daniel-nagy any comments on the latest suggestion?

from md-data-table.

webpartisan avatar webpartisan commented on July 30, 2024

I use angular-translate and would be good to use it with md-label together. Now there is no two-way binding with md-label and I can't change translation dynamically

from md-data-table.

felansu avatar felansu commented on July 30, 2024

+1

from md-data-table.

gabrielAnzaldo avatar gabrielAnzaldo commented on July 30, 2024

Agree with @webpartisan I can not change the label dinamically with angular translate.

from md-data-table.

Pelu2k12 avatar Pelu2k12 commented on July 30, 2024

+1

from md-data-table.

raulsperoni avatar raulsperoni commented on July 30, 2024

@shivasingh0101 could you solve this? i'm facing the same problem...

from md-data-table.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.