这是因为angular.element()这个API并不能支持类似jquery的选择器,也就是说angular.element()并不支持selector。最好引入JQuery框架,因为jQuery框架选择元素实在是太方便了。如果我们确实不想使用jQuery,那么可以使用HTML5中的document.querySelector(),这个API是支持选择器的。有一点特别需要注意:如果页面中使用了jQuery和angular,那么一定要先加载jQuery框架,然后再加载angular。...
分类:
Web程序 时间:
2015-08-31 15:19:33
阅读次数:
221
在单页面应用中,前端通常需要一套路由机制,这样当url发生变化时就可以做出一些处理,从而让页面显示不同的内容。Backbone及Angular里面内置的都有一套路由实现,但有时候可能并不想使用整个框架,只需要路由处理...
分类:
编程语言 时间:
2015-08-31 13:46:35
阅读次数:
195
const angular = require("angular");
const jqLite = angular.element;/**
* @ngdoc service
* @name commonModal
* @module common.modal.service
*
*/module.exports = angular.module('common.modal.service...
分类:
其他好文 时间:
2015-08-30 19:32:10
阅读次数:
229
采用get方式获取数据原来项目中的数据都是用过post方式获取的,获取流程是,现在是首先是angular中的router路由配置when---html—ctrl三方,先是在html中进行点击submit之后到angular前端的路由中进行查找相关的ctrl,然后再ctrl中会调用相应的方法。以log...
分类:
其他好文 时间:
2015-08-29 20:09:12
阅读次数:
177
Notice that the view names are now specified as absolute names, as opposed to the relative name. It is targeting the ‘filters‘, ‘tabledata‘, and ‘graph‘ views located in the root unnamed template. ...
分类:
其他好文 时间:
2015-08-29 11:18:56
阅读次数:
194
var routerApp = angular.module('routerApp', ['ui.router']);routerApp.config(function ($stateProvider, $urlRouterProvider) { $urlRouterProvider.othe...
分类:
Web程序 时间:
2015-08-28 00:40:57
阅读次数:
182
前言:很久没更新博客,最近公司pc端技术选型用angular,这几天就赶鸭子上架,硬着头皮直接上手angular。其中有许多小坑陆陆续续踩起走。今天就遇到一个比较常见的问题:图片上传。主题:图片上传服务器,然后通过服务器传阿里云。下面直接贴前端代码:$http({ method: 'POST', ....
分类:
Web程序 时间:
2015-08-27 22:57:47
阅读次数:
212
Understanding Controllers (控制器) In Angular, a Controller is a JavaScript constructor function that is used to augment the Angular Scope.When a Control...
分类:
其他好文 时间:
2015-08-27 21:04:30
阅读次数:
174
Services(服务)Angular services are substitutable objects that are wired together using dependency injection (DI). You can use services to organize and s...
分类:
其他好文 时间:
2015-08-27 21:03:38
阅读次数:
218
本文转发自:http://www.ngnice.com/posts/2c8208220edb94在Angular群里回答新手问题一段时间了,有一些Angular方面的坑留在这里备查,希望能对各位有所帮助。这个文章将来会随时更新,不会单独开新章,欢迎各位订阅。Q1. 错在哪里?如果你这么写过,会发现这...
分类:
其他好文 时间:
2015-08-27 20:35:17
阅读次数:
165