您应该尝试编译 pageinit 事件的视图。尝试这个
Framework7.prototype.plugins.angular = function(app, params) {
function compile(newPage) {
try {
var $page = $(newPage);
var injector = angular.element("[ng-app]").injector();
var $compile = injector.get("$compile");
var $timeout = injector.get("$timeout");
var $scope = injector.get("$rootScope");
$scope = $scope.$$childHead;
$timeout(function() {
$compile($page)($scope);
})
} catch (e) {
//console.error("Some Error Occured While Compiling The Template", e);
}
}
return {
hooks: {
pageInit: function(pageData) {
compile(pageData.container);
}
}
}
};
并在初始化 framework7 应用程序时设置此插件
new Framework7({
....
angular : true
....
})
有关更多详细信息,您可以参考下面的 github repo 以及完整的演示
https://github.com/ashvin777/framework7.angular