似乎无法让state.go工作

时间:2016-05-04 14:50:24

标签: angularjs

我正在尝试使用以下代码:

    scope.takeTest = function (assessment) {
        console.log(assessment._id);
        state.go('app.tab.assessments', { id: assessment._id });
        console.log('hi');
    };

我已经离开了日志,所以你可以更好地理解。第一个输出一个id,所以我知道id:assessment._id确实有效。

但是,当我在浏览器中单击此按钮时,它不会更新链接。

我还应该指出,当我点击按钮激活上面的代码时,我已经在同一个satte,我想改变。我只需要为它添加id。

也许这就是为什么?

2 个答案:

答案 0 :(得分:0)

请尝试以下操作。

$state.transitionTo($state.current, $stateParams, {
  reload: true,
  inherit: false,
  notify: true
});

答案 1 :(得分:0)

您似乎正在注入<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape android:shape="oval"> <gradient android:startColor="#F44336" android:endColor="#E57373" android:angle="270" /> <stroke android:width="10dp" android:color="#607D8B" /> </shape> </item> <item android:state_focused="true"> <shape android:shape="oval"> <gradient android:startColor="#3F51B5" android:endColor="#9FA8DA" android:angle="270" /> <stroke android:width="10dp" android:color="#607D8B" /> </shape> </item> <item> <shape android:shape="oval"> <gradient android:startColor="#2196F3" android:endColor="#BBDEFB" android:angle="270" /> <stroke android:width="1dp" android:color="#607D8B" /> </shape> </item> </selector> 而不是state,或者您$state

中拼写错误$state
相关问题