找传奇、传世资源到传世资源站!

angular 实现多国语言网站 实例源码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

AngularJSil8n
angular 实现多国语言网站 实例源码 Ajax框架/RIA-第1张@{ Layout = null;}<!DOCTYPE html><html ng-app="app"><head> <meta name="viewport" content="width=device-width" /> <title>Index</title> <script src="~/Scripts/jquery-1.10.2.min.js"></script> <script src="~/Scripts/angular.min.js"></script> <script src="~/Scripts/angular-translate.min.js"></script> <script src="~/Scripts/loader-static-files.js"></script> <script src="~/Scripts/angular-sanitize.min.js"></script> <script type="text/javascript"> var app = angular.module("app", ['pascalprecht.translate', 'ngSanitize']); var test = "<div ng-bind-html='\"hi\" | translate'></div>"; app.config(['$translateProvider', function ($translateProvider) { $translateProvider.useStaticFilesLoader({ prefix: '/il8n/', suffix: '.json' }); $translateProvider.preferredLanguage("zh-cn"); }]); app.directive("directive", function () { return { restrice: "AE", replace: true, template: test }; }) $(function () { $("#a").html(test); }); </script></head><body> <h1 ng-bind-html="'hi' | translate"></h1> <h1 ng-bind-html="'git' | translate"></h1> <directive> </directive> <div id="a"></div></body></html>

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复