自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(95)
  • 资源 (11)
  • 收藏
  • 关注

原创 angularjs select

1. 第一种方法$scope.colors = [ {name:'black', shade:'dark'}, {name:'white', shade:'light'}, {name:'red', shade:'dark'}, {name:'blue', shade:'dark'}, {name:'yellow', shade:'light'}];$sc...

2016-03-16 09:06:50 163

原创 OSGI bundle control tomcat start&stop

需求:在OSGI应用中,启停Tomcat Server。比较奇怪哦,我也觉得。这个需求的目的,是为了部署某个特定的应用。本来使用Spring DM、Apache flex or其他支持OSGI的App server(如jboss)就很容易将web应用移植到osgi容器中。但人家强调web应用已经在tomcat中成功部署,为了省事和产品的统一性,我就使用java执行bat,权当稳住局面,后续...

2012-06-19 21:17:58 172

原创 javamail

一个简单javamail的实现(HelloWorld)

2012-04-20 08:35:55 249

原创 Google资料查询

解压后的文件放置到 :{systemDisk}\Windows\System32\drivers\etc

2011-12-06 09:57:53 135

文件夹生成树状结构(&sources)

附件中有个可执行文件,可以生成文件夹的树状结构。

2011-09-24 15:39:32 300

原创 目录树的生成

项目上线需要生成个目录树文件,本来可以用dos的tree就搞定的,领导非得要统计每个文件下的子文件数目。没办法,只好找了点资料随便写了个JFrame。import java.awt.BorderLayout;import java.awt.Color;import java.awt.Dimension;import java.awt.Toolkit;import java.aw...

2011-09-22 08:54:14 126

原创 div & js 模拟select组件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>&l

2011-08-26 11:15:45 144

原创 removeChild的部分使用技巧

在javascript中,可以使用removeChild删除一个对象的子元素。但如果是使用循环删除复合一定条件的子元素时,请使用逆序。原因:正序时,删除一子元素时,后面的元素index可能会发生改变,造成删除出错or删除不净。eg. function removeInputElementsFromForm(formName,inputNamePre){ var formObj ...

2011-08-16 16:54:48 309

js的startWith和endWith

<html> <head> <script> function doStartAll() { var allCheck = document.updateBusinessForm.getElementsByTagName("input"); var checkList=''; for(var i=0; i<allCh...

2011-08-16 11:32:13 405

原创 常用JavaScripts函数

/*** 判断客户端浏览器类型的变量*/var isIE = (navigator.appName == 'Microsoft Internet Explorer');var isNetscape = (navigator.appName == 'Netscape');/*** 清空页面所有输入框的内容,包括文本和密码*/function clearInput(...

2011-08-15 09:06:52 193

原创 文本框输入限制

【转自】http://www.blogjava.net/sy1214520/archive/2008/12/02/243907.html1上面的文本框只能输入数字代码(小数点也不能输入):<input  onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.re...

2011-07-15 15:33:49 102

原创 界面输入输入法全角半角的处理

全角字符一半用于排版等,在编程中通常是禁止使用的。而用户错误的输入(全角,占两个字符),很容易超出限长或者给用户带来错觉。所以有必要把全角转半角。<html><head><script language="javascript" type="text/javascript">/*****************************参数说明...

2011-02-26 11:46:41 211

原创 货币符号转换-JS

/* * 货币符号转汉语,如CNY 人民币 */function money_e_zh(e) { var myCurrencyArray = new Array ("CNY","EUR","USD","GBP","AUD", "JPY","HKD","MOP", "TWD","AFA",

2011-02-17 14:34:54 1064

原创 常用js特效

【转自】http://blog.myspace.cn/e/400006157.htm禁止页面复制、保存等常用js命令<body onselectstart="return false"> 取消选取、防止复制<noscript><iframe src=*.html></iframe></noscript> 网页将不能被另存为<li..

2010-12-08 17:19:18 111

原创 JEE中上下文地址的获取path && basePath

String path = request.getContextPath();String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";结果:/tasklist-ies http://localh...

2010-10-22 17:00:45 108

原创 Spket 1.6.18的简单破解

刚开始学习ext ,选用Spket作为开发工具,发现需要破解,找到了简单方法 修改目标插件:com.spket.ui_1.6.18.jar用附件替换class文件:com\spket\ui\internal\License.class然后重启Spket, OK ...

2010-10-11 10:47:34 172

原创 SSH2示例

两个示例,见附件。DROP TABLE IF EXISTS `game`.`books`;CREATE TABLE  `game`.`books` (  `book_id` int(11) NOT NULL default '0',  `book_name` varchar(200) default NULL,  `book_author` varchar(100) default NULL,...

2010-09-16 16:44:35 88

原创 JBoss JBPM4请假流程示例

见附件

2010-09-16 16:11:40 108

原创 Struts权限过滤器

见附件

2010-09-16 16:09:01 81

原创 hibernate官方入门教程 (转载)

hibernate官方入门教程第一部分 - 第一个Hibernate程序 首先我们将创建一个简单的控制台(console-based)Hibernate程序。我们使用内置数据库(in-memory database) (HSQL DB),所以我们不必安装任何数据库服务器。 让我们假设我们希望有一个小程序可以保存我们希望关注的事件(Event)和这些事件的信息。 (译者注:在本教程的后面部分,我...

2010-09-03 15:04:43 102

原创 MySQL的中文UTF8乱码问题

乱码的发生防不胜防:插件开发配置文件有时候会产生乱码,java文件在编码错误的时候也会有乱码,做web的时候经常在将数据存入到数据库的时候发生乱码......结果,我心乱如麻。还好,经历的多了 乱码问题也成小儿科啦! 话说Mysql乱码:背景:1.jsp文件全部使用utf-82.编码过滤器也是用utf-83.创建数据库的时候也标注了使用UTF-8eg.CREAT...

2010-09-01 16:34:18 168

原创 【转】PowerDesigner12 简单应用

【转自:http://www.cnblogs.com/kay/archive/2007/06/07/774361.html】一直不是对PowerDesigner很熟悉,近期频繁笔试,很多都问这个工具,所以今天下午简单学习了一下。一、创建概念模型1.在File下选择New中的Conceptual Data Model:2.在打开的视图窗口中使用工具箱中的实体工具创建两个实体,分别为学生表和班级表...

2010-08-02 13:19:36 80

原创 Eclipse Tip: Define Custom Content Types to Identify Your Data Files

【转自】http://www.developer.com/java/data/article.php/3648736/Eclipse-Tip-Define-Custom-Content-Types-to-Identify-Your-Data-Files.htmIn desktop environments, the typical approach for identifying a file...

2010-06-13 08:53:40 126

原创 WTP Facet 之 AddFilter

做插件开发的人员都知道,如果你不晓得该使用那个Eclipse提供的api工具类,你做起来很痛苦。今天做facet的时候,发现j2ee 和 jee 是有区别的,自己琢磨着把程序功能做了出来,费了好大劲。 今天偶尔看到这一个facet,顿时感慨,如果早看到它,也不用那么费神了。/******************************************************...

2010-06-11 14:22:20 104

使用Facelet出现的中文编码问题: Invalid path

jsf放置了一段时间,今天重新拾起。 发现了一个怪问题:使用facelet的时候,布局中涉及中文,总是报“Invalid path”异常。如:inputname.xhtml @5,44 <ui:composition template="/templates/sample-layout.xhtml"> Invalid path : /templates/sample-lay...

2010-04-22 11:22:12 130

Properties文件的读写 : Properties操作示例

package properties;import java.io.BufferedInputStream;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;impor...

2010-04-21 14:19:24 78

Java 正则表达式 小计

【参考】http://blog.csdn.net/jiaguanghan123/archive/2010/01/20/5217511.aspx  正则表达式虽然好用,但在比较复杂情形下很容易出错,好记性不如烂笔头。列下备记:1.URL("^(http|www|ftp|)?(://)?(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*((:\\d+)?)(/(\...

2010-04-16 10:28:02 97

wizardPage参考

插件向导开发最好的例子莫过于Eclipse中本身一些向导,但如何去找不易记住 一些常规界面组件,如:容器、类、项目、包等,可以参考以下类: NewAnnotationWizardPage NewClassWizardPage NewContainerWizardPage NewElementWizardPage NewEnumWizardPage NewInterfaceWizardPage Ne...

2010-04-15 13:23:02 227

如何访问当前Project???

【转】http://wiki.eclipse.org/FAQ_How_do_I_access_the_active_project%3F作为新手,好多人会问:如果获取Active Project、Active File、and active folder。事实上,在eclipse中不存在“Active”Project 和File;只有当前的(currently)project和file。那么如...

2010-04-14 08:27:25 105

rcp小游戏:青蛙回巢

看到的一个rcp小游戏:青蛙回巢,回头好好看看源码

2010-04-08 09:03:09 124

使用CXF: Java 2 WSDL

java编程:纯java代码进行java类向wsdl文件的转换。com.test.java2wsdl.rarcxf配置及命令行cxf环境变量配置以及命令.rar

2010-04-08 09:00:06 89

How to create dynamic web project using facets

To create a blank faceted project, you can use one of the ProjectFacetsManager.create() methods.Once the project is created you will need to set fixed facets (those facets that the user cannot deselec...

2010-03-22 08:51:22 74

调用CXF工具 生成 WSDL

在做WebService的时候,生成WSDL是必不可少的一步。我们通常使用的工具就是Axis和CXF。CXF提供了一个命令行工具,可以通过命令来生成Java to WSDL,也可以由WSDL生成Java类。 本文不讲解CXF的工具使用,只考虑我们在java程序中如何调用该工具来生成java代码,这种运用情形在插件开发中是常见的。 思路:1.首先考虑到:Runtime.get...

2010-03-18 16:12:36 251

Introduction to the XSD Editor(XML Schema Editor)

By Trung Ha August 30, 2006 This tutorial will use the catalog.xsd from the "Editing and validating XML files" Examples. To create it, select New -> Examples... to launch the wizard. Follow the...

2010-03-13 16:46:20 151

十二生肖

十二生肖           

2010-03-11 21:31:31 131

单一职责原则

SRP(Single Responsibility Principle 单一职责原则) there should never be more than one reason for a class to change. 我们知道,在面向对象设计中要做到高内聚低耦合。而单一职责原则就是实现高内聚低耦合的最好办法。面向对象设计中单一职责原则是指:    一个类只负责一个功能领域中的相应...

2010-03-11 09:59:12 117

设计原则之开闭原则

【转自】itpub http://tech.it168.com/a2009/0727/612/000000612707.shtml     开闭原则是设计原则基础的基础,其它原则均围绕开闭原则进行展开。开闭原则也就是一个软件实体应当对扩展开放,但对修改关闭。满足了开闭原则的设计,我们的系统将达到在设计稳定的基础上,方便的对软件进行扩展,插入新的功能模块的目的。     怎么样做的开闭原...

2010-03-11 09:12:36 128

原创 Java 字符串解惑

【转】http://tieba.baidu.com/f?kz=606368283现在正式大家忙着找工作的时候,往往参加完各公司的笔试后,大家会讨论这些笔试题目。昨天在年级的就业信息群里,大家讨论了这样一个问题:String a=”blog”+”java”;这个语句会产生几个java对象?有的人说三个,有的人说四个。究竟是几个呢?java中字符串类型是个非常特殊的类型,也是最常用的类型,正因为它...

2010-03-05 12:59:58 104

Facelets UI 标签参考

【转载】http://lalalabs.blog.163.com/blog/static/943252022009113693235/ui:composition    UI Composition标签是一个模板标签,它包装的内容被列在另一个Facelet中。任何UI Composition标签外的内容会被Facelets 视图处理器忽略。当另一个Facelets页面包含了具有UI Compo...

2010-02-25 21:56:59 211

同类编辑器只能打开一个

在(http://sxw7362693.iteye.com/blog/557633)中看到:编辑器输入匹配策略: 在org.eclipse.ui.editors扩展点中有个matchingStrategy的元素,可以实现IEditorMatchingStrategy接口,覆写public boolean matches(IEditorReference editorRef, IEd...

2010-02-23 13:28:45 90

AngularJS - Novice to Ninja.pdf.pdf )

非常不错的书 Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Who Should Read This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Conventions Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii Code Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii Tips, Notes, and Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix Supplementary Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix Want to Take Your Learning Further? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx Chapter 1 Falling In Love With AngularJS . . . . . 1 The Power Features of AngularJS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Download and Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Installing via CDN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Hosting on Your Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Required Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 AngularJS Batarang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 The Angular Seed Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 The Anatomy of an AngularJS app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 What is MVW? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Structuring Our Code With MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Unit and End-to-End Testing in AngularJS . . . . . . . . . . . . . . . . . . . . . . . . 17 Where to Put Your Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 How to Run Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 When Not To Use AngularJS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Chapter 2 Modules, Controllers & Data Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Creating Our First Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Modular Programming Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 The Role of a Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Attaching Properties and Functions to Scope . . . . . . . . . . . . . . . . . . 30 Adding Logic to the Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Adding Instance Functions and Properties to Controllers . . . . . . . . 35 Dependency Injection in Controllers With Minification . . . . . . . . . 37 Overview of Two-Way Data Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 What Is Data Binding? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Two-Way Binding in AngularJS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Doing Something Cool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Introducing Our Demo Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 The Single Page Blogger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Getting Ready . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Chapter 3 AngularJS Scope & Events . . . . . . . . . . . . 45 Scope Demystified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Writing Access with Prototypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Objects Can Extend Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Prototypal Inheritance in AngularJS Scopes . . . . . . . . . . . . . . . . . . . . . . . 49 Advanced Scope Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 The Watchers in AngularJS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 The $watchCollection() Function . . . . . . . . . . . . . . . . . . . . . . . 56 The $apply() Function and the $digest Loop . . . . . . . . . . . . . . 57 $apply and $digest in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 x Broadcasting & Emitting Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 $scope.$emit(name,args) For Emitting Events . . . . . . . . . . . . 64 $scope.$broadcast(name,args) For Broadcasting Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 $scope.$on(name,handlerFunction) For Registering Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Events in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 The $destroy event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Chapter 4 Multiple Views and Routing . . . . . . . . . 71 Creating Multiple Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Using $routeParams in the Controller . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Using ng-template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 The resolve Property in the Route Config Object . . . . . . . . . . . . . . . . . 83 Exploring the $location Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 The API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Events in Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 $location related events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 $route related events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 The ng-include Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Introducing the Angular UI Router . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Getting Started With UI Routter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Defining States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Chapter 5 AngularJS Services, Factories, and Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 xi Eager Loading of a Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Factory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Using Decorators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Chapter 6 Developing Single Page Blogger . . . 113 Developing Our App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Defining Routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Creating Our Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Creating the Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Creating the Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 App Entry Point (index.html) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 How About Some Unit Tests? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Unit Testing postService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Unit Testing Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Writing an End-to-End (e2e) Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Chapter 7 Understanding AngularJS Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 AngularJS Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 <input> and <textarea> controls . . . . . . . . . . . . . . . . . . . . . . . 130 <select> control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Radio Button Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Checkbox Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 AngularJS Form Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 xii Applying Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Updating Models With a Twist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Forms in Action : Single Page Blogger v1.1 . . . . . . . . . . . . . . . . . . . . . . . 143 Creating the admin Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Defining States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Creating Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Admin Panel Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Template For Adding a New Post . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Chapter 8 Interacting with REST APIs . . . . . . . . . 151 A Primer on Promises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 The Promise API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Example Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 Promise Chaining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 Creating a Promise that Always Rejects . . . . . . . . . . . . . . . . . . . . . 159 Understanding the $http Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 The config Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 A Weather Search Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Setting Request Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Request and Response Transformers . . . . . . . . . . . . . . . . . . . . . . . . 166 Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Interceptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Understanding AngularJS $resource . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 How Does $resource Work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 xiii Chapter 9 Using REST APIs in Single Page Blogger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 Applying $resource to Our App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 Defining Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Defining Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 Including angular-resource.js and Adding the ngResource Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Unit Testing Our Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Chapter 10 AngularJS Directives . . . . . . . . . . . . . . . . . . 193 What Are Directives, Really? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 Directives From the jQuery Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Creating Custom Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 The Link Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 The Compile Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 Compilation of Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 Changing a Directive’s Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 Binding Between Parent Scope and Isolated Scope Models . . . . . . . . . 207 Using @ For One-Way Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Using = For Two-Way Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 Using & to Execute Functions in the Parent Scope . . . . . . . . . . . . 209 Parent Scope vs. Child Scope vs. Isolated Scope . . . . . . . . . . . . . . . . . . . 212 Transclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 Differences Between transclude:'element' and transclude:true . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 The Controller Function and Require . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214 Cleaning Up Your Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 IE 8 Precautions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 xiv Chapter 11 Adding a Comment System to Single Page Blogger . . . . . . . . . . . . . . . . . . . . 219 Unit Testing Our Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Chapter 12 Dependency Injection In AngularJS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 A Brief Recap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 The $provide Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 The $injector Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Dynamically Injecting a Dependency . . . . . . . . . . . . . . . . . . . . . . . . 230 Registration of Controllers, Filters, and Directives . . . . . . . . . . . . . 230 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Chapter 13 AngularJS Filters . . . . . . . . . . . . . . . . . . . . . . . 233 Filter Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Fun with Custom Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Chaining Multiple Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Using Filters in Controllers, Services, and Directives . . . . . . . . . . . 236 Meet a Filter Called filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 Meet the orderBy Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 Meet the limitTo Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 Using the $filter Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 Using Filters in Single Page Blogger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 Permalink Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 Wordcount Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 xv Chapter 14 AngularJS Animation . . . . . . . . . . . . . . . . . 245 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Animation with CSS3 Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Going Further . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 Animation Using Keyframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 Animation Using jQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 Animation Using ngClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 Animation with Custom Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 Adding Simple Animation to Single Page Blogger . . . . . . . . . . . . . . . . . 257 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 Chapter 15 Deployment and Internationalization . . . . . . . . . . . . . . . . . . . 259 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 Chapter 16 Authentication and Authorization in AngularJS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271 Adding Login Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 Where To Go Next? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Things to Do Now . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 Improving Our Demo App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 Host it Yourself : Back-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

2015-06-15

《D3.js数据可视化实战手册 》迷你书.pdf )

《D3.js数据可视化实战手册 》迷你书.pdf

2015-06-15

JAVA大数加法与乘法

本例子实现了大数的加法与乘法,感觉实现不错

2010-07-30

快速打开文件夹 Eclipse插件 OpenExtern(google)

试用该插件 能够便捷的打开资源文件夹,包括源码

2010-04-15

自己动手写开发工具 源码及部分章节

自己动手写开发工具.rar包括: 《自己动手写开发工具》随书光盘.rar 自己动手写开发工具-部分章节.pdf

2010-04-15

图表FusionCharts TagLib JSF源码

FusionChartsTagLibSourceCode.zip 没想到只能上传一个附件,补上源码

2009-08-19

图表fusioncharts JSF taglib 和 源码

在JSF中使用fusioncharts,是多么令人兴奋的事! 最近试用fusioncharts,找到了fusioncharts的jsf1.2的jar包,好高兴,分享。 环境: jsf1.2 + facelts + richfaces + fusioncharts

2009-08-19

Richfaces get started

Richfaces start。it's very good.

2009-06-25

eclipse 属性页

属性页 properties:table / tabletree/ tab

2009-03-12

Manning - SWT JFace in Action

也是经典的SWT Jface教程

2008-03-05

GEFand EMF

经典GEFand EMF学习资料,号称红宝书

2008-03-05

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除