Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Use localization in html template files #537


User avatar
0
omital created

Hi, What is best way for use localization in html templateUrl file ?


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    I generally use .cshtml instead of .html. But if you use .html, you should use client-side localization API described here: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Localization#DocInJavascript">http://www.aspnetboilerplate.com/Pages/ ... Javascript</a> You have different options, you can create a angular filter or add a Localize method to your scope...

  • User Avatar
    0
    omital created

    I use .chtml file generraly but for situation that we want view modal like this

    var modalInstance = $modal.open({
                    animation: true,
                    templateUrl: 'app/Main/views/factorForm/factorEditForm.html',
                    controller: ctrlrIdEditFactor,
                    size: 'lg',
                    resolve: {
                        item: function () {
                            if (vm.factorForm.factorFormFactors == null)
                                vm.factorForm.factorFormFactors = new Array();
                            if (vm.factorForm.factorFormFactors.indexOf(itm) == -1)
                                    return itm;
                            else
                                return angular.copy(itm);
                        }
                    }
                }
    

    we cant use .chtml

  • User Avatar
    0
    hikalkan created
    Support Team

    OK, than you can use client side localization as I said before :)