私はMETEORを初めて使いました。流星と角を使ってアプリケーションを作成しました。しかし、私はリダイレクションのものに苦しんでいます。エントリを作成した後、リストページにリダイレクトしたいエントリーを作成した後、流星群アプリケーションでui-stateを変更します。
はコードの下に見つける:
import angular from 'angular';
import angularMeteor from 'angular-meteor';
import uiRouter from 'angular-ui-router';
class ProsperFilterAdd {
constructor($stateParams, $scope, $reactive, $location) {
'ngInject';
$reactive(this).attach($scope);
}
save(){
this.call('filters.insert', this.formData);
// TODO: NEED TO REDIRECT AT LIST PAGE OF FILTERS
}
}
export default angular.module(name, [
angularMeteor,
uiRouter
]).component(name, {
templateUrl: `imports/ui/components/${name}/${name}.html`,
controllerAs: name,
controller: ProsperFilterAdd
})
.config(config);
function config($stateProvider) {
'ngInject';
$stateProvider
.state('prosper_filter_create', {
url: '/prosper_filters/create',
template: '<prosper-filter-add></prosper-filter-add>'
});
}
私はミスをやっているところ、私を導いてください。
..エラー:$状態はあなたがコントローラに$状態を注入なかった – user1787700
が定義されていませんか?チェックコンストラクタ($ stateParams、$ state、$ scope、$ reactive、$ location)行 – shershen
はい、注入しました。コンストラクタ($ stateParams、$ state、$ scope、$ reactive、$ location) – user1787700