angular 怎么在加载页面之前动态读取数据

2025-05-15 06:43:48
推荐回答(1个)
回答1:

var module = angular.module('testApp', [])
.controller('myC',function(){
$scope.ta = [1,2,3,4,5,6];

})
.directive('onFinishRender', function () {
return {
restrict: 'A',
link: function (scope, element, attr) {
if (scope.$last === true) {
element.ready(function () {
$("#r_img").remove();