我正在从视图 1 中单击按钮传递数据,现在我希望将此数据传递到另一个视图(视图 2)。我在按钮单击时调用另一个状态。请说明我如何传递数据?
$scope.getSample=function(){
$scope.spreadsheet=$scope.SpreadsheetLists.name;
$scope.worksheet=$scope.SheetList.properties.title;
$state.go('view2');
};
我不想使用这样的状态参数:
$state.go('view2',key:$scope.worksheet);
使用 $rootScope.data = "一些数据"; 并在其他控制器中检索。或创建工厂方法并通过工厂传递值。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句