【发布时间】:2016-03-01 05:51:34
【问题描述】:
我正在使用 Meteor、Angular 和 Ionic。我很难从状态 A 更改为状态 B,因为我不断收到错误消息“只允许一个 babel/polyfill 实例”。我尝试尽可能多地清理以下代码。请注意,我可以成功更改为其他状态。
这是我的 routes.js 文件:
.state('create-group', {
url:'/create-group:/:buddyId',
templateUrl: 'client/templates/create-group.ng.html',
controller: 'createGroupCtrl'
})
这是我的 A 州模板:
<ion-item ng-repeat="buddy in buddies" ng-click="createGroup({{buddy}})">
</ion-item>
这是我的状态 A 控制器:
angular
.module('app')
.controller('whosDownCtrl', whosDownCtrl);
function whosDownCtrl ($scope, $state, $ionicScrollDelegate, $timeout, $meteor) {
$scope.createGroup = createGroup;
function createGroup(buddy) {
$state.go('create-group', { buddyId: buddy._id});
}
};
这是我的 B 州控制器:
angular
.module('app')
.controller('createGroupCtrl', createGroupCtrl);
function createGroupCtrl ($scope, $stateParams) {
var clickedUser = $stateParams.buddyId;
}
谁能看到我做错了什么?
【问题讨论】:
标签: javascript angularjs meteor angular-ui-router ionic