jquery与angular的交互
HTML:
<table class="table table-striped" ng-app="myApp">
<tr>
<th>时间</th>
<th>教练员</th>
<th>学员</th>
<th>车牌号</th>
<th>SIM</th>
<th>经度</th>
<th>纬度</th>
<th>方向</th>
<th>速度(km/h)</th>
<th>操作</th>
</tr>
<tr ng-controller="myCtrl">
<td>{{obj.gpsTime}}</td>
<td>{{obj.coachName}}</td>
<td>{{obj.studentName}}</td>
<td>{{obj.licnum}}</td>
<td>{{obj.sim}}</td>
<td>{{obj.lng}}</td>
<td>{{obj.lat}}</td>
<td>{{obj.direct}}</td>
<td>{{obj.speed}}</td>
<td><a title="立即拍照" href="#" class="ljpz"><i class="fa fa-camera"></i></a></td>
</tr>
</table>
JS:
1. angular(不能放在jquery的onready事件中)
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.obj = {
gpsTime : '',
coachName : '',
studentName : '',
licnum : '',
sim : '',
lng : '',
lat : '',
direct : '',
speed : ''
};
});
2.jquer
y(可以放在一个函数或ready事件中)
var scope = $('tr[ng-controller="myCtrl"]').scope();// 获得angular的作用域
scope.obj.coachName = 'hi';
scope.$apply();// 绑定到视图
jquery与angular的交互的更多相关文章
- 深入理解jQuery、Angular、node中的Promise
最初遇到Promise是在jQuery中,在jQuery1.5版本中引入了Deferred Object,这个异步队列模块用于实现异步任务和回调函数的解耦.为ajax模块.队列模块.ready事件提供 ...
- Deferred在jQuery和Angular中的使用与简单实现
Deferred在jQuery和Angular中的使用与简单实现 Deferred是在jQuery1.5版本中加入的,并且jQuery使用它完全重写了AJax,以前也只是偶尔使用.但是上次在使用Ang ...
- 跨域WebApi的Jquery EasyUI的数据交互
目录 1 大概思路... 1 2 创建WebAPI 1 3 创建CrossMainController并编写... 1 4 Nuget安装microso ...
- Selenium Webdriver wait for JavaScript JQuery and Angular
Hi all, during the last two weeks I was dealing with the best solution to wait for both JQuery, Angu ...
- thinkphp+jquery+ajax前后端交互注册验证
thinkphp+jquery+ajax前后端交互注册验证,界面如下 register.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. ...
- 【Angular JS】正确调用JQuery与Angular JS脚本 - 修复Warning: Tired to load angular more than once
自己正在做一个小网站,使用Angular JS + Express JS + Mongo DB,在开发过程中,遇到一些问题,所以整理出来.希望对大家都有帮助. 这是今天解决的一个问题,Angular ...
- Web端主流框架,jquery、angular、react、vue
不得不说,前端技术发展非常迅速,时不多久就有一个新的东西冒出来,并且迅速膨胀发展,让旁观者眼花缭乱,让开发者目眩神迷,但总体上来说,这波互联网大浪潮带动了前端技术的大发展,给曾经那些苦苦挣扎于DOM操 ...
- Spring Mvc模式下Jquery Ajax 与后台交互操作
1.基本代码 1)后台控制器基本代码 @Controller @RequestMapping("/user") public class UserController { @Aut ...
- 轻量jquery框架之--组件交互基础设计
概要 组件交互基础,即考虑在JQUERY对象下($)下扩展所有组件都需要用到的通用api,如ajax入口.对表单的操作.html片段加载.通用的配合datagrid通用的curd客户端对象等. 扩展a ...
随机推荐
- iis7设置http跳转https实测可用
前面ytkah和大家聊了Apache设置http如何301到https,现在我们说说iis7设置http跳转https,因为还是有很多人在用iis服务器.首先要先安装url rewrite modul ...
- firstResponder
https://developer.apple.com/library/content/documentation/EventHandling/Conceptual/EventHandlingiPho ...
- The Ultimate Guide to handling JWTs on frontend clients (GraphQL)
转自:https://blog.hasura.io/best-practices-of-using-jwt-with-graphql/ hasura 团队关于jwt 的实践 JWTs (JSON We ...
- [RN] React Native 删除第三方开源组件依赖包 后 还要做的 (以 删除 react-native-video为例)
近期测试使用了下 react-native-video 使用一直不成功,后来想着删除掉, 使用命令: npm uninstall react-native-video 重新编译后,还是一直报错 后来 ...
- [golang][gui]Hands On GUI Application Development in Go【在Go中动手进行GUI应用程序开发】读书笔记03-拒交“智商税”,解密“GUI”运行之道
和老外的原文好像没多大联系了,哈哈哈,反正是读书笔记,下面的内容也是我读此书中的历程,也写进来吧.不过说实话,这框架的作者还挺对我脾气的,哈哈哈. 拒交“智商税”,解密“GUI”运行之道 我很忙 项目 ...
- MySQL 是如何利用索引的
阅读本文大概需要 4 分钟. 一.前言 在 MySQL 中进行 SQL 优化的时候,经常会在一些情况下,对 MySQL 能否利用索引有一些迷惑.例如: MySQL 在遇到范围查询条件的时候就停止匹配了 ...
- css选择指定元素
.butSpan:){ margin-left: 10px; } nth-child(n+2)括号内可以是公式 可是是数字
- [原创]敏捷管理实践Scrum思维导图
[原创]敏捷管理实践Scrum思维导图
- cv2 的用法
转载:https://www.cnblogs.com/shizhengwen/p/8719062.html 一.读入图像 使用函数cv2.imread(filepath,flags)读入一副图片 fi ...
- mybatis在sql中的CDATA区
示例 <if test="startTime != null"> <![CDATA[ AND rra.create_time >= #{startTime} ...