jquery CSS 未应用于 AngularJS 路由



我希望用jquery mobile实现angularjs,除了没有应用jquery mobile css之外,一切都很好。

当我不在 angularjs 中使用路由但使用路由时,它有效,css 停止工作。

我该怎么办?我还包括了jquery-mobile-angular-adapter它仍然不起作用。

"如果您在客户端生成新的标记或通过 Ajax 加载内容并将其注入页面,则可以触发 create 事件来处理新标记中包含的所有插件的自动初始化 http://jquerymobile.com/demos/1.0/docs/pages/page-scripting.html。

要解决这个问题,你必须告诉JQuery在Angular加载内容后初始化所有插件,你可以在控制器中执行此操作。

$scope.$on('$viewContentLoaded', function() {
    $(document).trigger('create'); //$(document) or just the part that was loaded with ajax
});

我不知道jquery-mobile-angular-adapter,所以我帮不上忙。

最新更新