1
Tutorial: 101 Intro to UI-Gridの紹介チュートリアルに続いてAngular UI Gridを私のアプリケーションに追加しようとしています。
まず、グリッドがの作品、私はすぐに私が働いていたプロジェクト(ただ、実際にどこでもそれを使用せずに、モジュールとして追加)インターセプタに追加すると、コントローラにそれを作成し、表示し結合するが、 することができますより詳細には、ビューテンプレートのロードには、ng-include(以下のコード抜粋を参照)が必要です。
編集:ng-includesが機能しますが、インターセプタを通過するのではなく、存在しないため動作します。私が試した何
- アンギュラ1.4.8
- UIグリッド3.2.1
- のjQuery 2.2.0
:
- 他の角度のバージョンを使用して、
- しようとしました工場の初期インターセプタ、
- 初期配列のモジュールの順序を変更しました。
- 他のjQueryバージョンを試してみました。
おそらく他のモジュールでこのような問題に直面した人はいますか?
HTML:
<body>
<div ng-app="app">
<div ng-controller="app.views.layout as vm">
<div ng-include="'/App/Main/views/layout/header.cshtml'"></div>
<div class="container">
<div class="angular-animation-container row">
<div ui-view class="shuffle-animation col-xs-12"></div>
</div>
</div>
</div>
</div>
</body>
角度アプリケーションの初期化:
var app = angular.module('app', [
'ngAnimate',
'ngSanitize',
'ui.router',
'ui.bootstrap',
'ui.jq',
'ngTouch'
'ui.grid'
'abp',
]);
インターセプタ登録:
var abpModule = angular.module('abp', []);
abpModule.config([
'$httpProvider', function ($httpProvider) {
$httpProvider.interceptors.push(['$q', function ($q) {
return {
'request': function (config) {
if (endsWith(config.url, '.cshtml')) {
config.url = abp.appPath + 'AbpAppView/Load?viewUrl=' + config.url + '&_t=' + abp.pageLoadTime.getTime();
}
return config;
},
'response': function (response) {
if (!response.config || !response.config.abp || !response.data) {
return response;
}
var defer = $q.defer();
abp.ng.http.handleResponse(response, defer);
return defer.promise;
},
'responseError': function (ngError) {
var error = {
message: ngError.data || abp.ng.http.defaultError.message,
details: ngError.statusText || abp.ng.http.defaultError.details,
responseError: true
}
abp.ng.http.showError(error);
abp.ng.http.logError(error);
return $q.reject(ngError);
}
};
}]);
}
]);
私のモジュールの初期化では、私はui.gridにui-grid ...がありませんでしたか? –
これはタイプミスで、Qを更新しました。 –
あなたのインターセプターが機能していないことをどのように知っていますか?いくつかのブレークポイントとデバッグを追加しようとしましたか? – Phil