AngularJs 父子级Controller传递数据
来源:互联网 发布:软件招聘平台 编辑:程序博客网 时间:2024/05/22 14:50
AngularJs 父子级Controller传递数据
- 博客分类:
- js
乔乐共享众观千象每天进步一点点学习永无止境angularjs
- <div ng-controller="MyAccountCtrl">
- <div ng-controller="TransferCtrl">
- .............
- </div>
- </div>
- // 子级传递数据给父级
- // 子级传递
- $scope.checkLoggedIn = function(type) {
- $scope.transferType = type;
- $scope.$emit('transfer.type', type);
- }
- // 父级接收
- $scope.$on('transfer.type', function(event, data) {
- $scope.transferType = data;
- });
- $scope.checkLoggedIn = function() {
- var type = $scope.transferType;
- }
- // 父级传递数据给子级
- // 父级传递
- $scope.transferType = '';
- $scope.checkLoggedIn = function(type) {
- $scope.transferType = type;
- $scope.$broadcast('transfer.type', type);
- }
- // 子级接收
- $scope.transferType = '';
- $scope.$on('transfer.type', function(event, data) {
- $scope.transferType = data;
- });
- $scope.checkLoggedIn = function() {
- var type = $scope.transferType;
- }
0 0
- AngularJs 父子级Controller传递数据
- angularjs的controller间数据传递
- angularJs 中ui-router 路由向controller传递数据
- javascript父子窗口传递数据
- angularJs中controller控制器scope父子集作用域实例
- angularJS中的父子作用域和兄弟作用域,以及父子,兄弟controller通信机制
- angularJS中的父子作用域和兄弟作用域,以及父子,兄弟controller通信机制
- controller传递数据的处理
- 父子进程通过管道传递数据
- javascript实现父子页面数据传递
- vue父子组件的数据传递
- angular2中父子组件的数据传递
- window.open父子窗口数据传递问题
- 非父子组件的数据传递
- Vue4种父子组件数据双向传递
- vue 父子组件之间的数据传递
- angularjs学习2---数据绑定与controller
- angularjs Controller
- 【DirectX3D】零基础画三角形
- 观察者模式
- 玩儿转C语言:字符和字符串
- 学习 线性表的顺序存储 总结一
- 用栗子打倒C++多态
- AngularJs 父子级Controller传递数据
- Python使用Rsa公钥加密,私钥解密以及私钥签名,公钥验签的例子
- 24-ssh启动出现rt.jar:Permission denied
- 汇编记录(99) 汇编指令
- android点击空白区域隐藏软键盘
- uImage、zImage、bzImage、vlinzx区别
- TextView实现跑马灯效果
- 正则表达式的学习与小结
- 款流行的Markdown编辑器