您的位置:首页 > Web前端 > AngularJS

angularjs用于移动开发

2015-03-11 22:31 295 查看
最近几个月,我一直在分享不同版本的“员工目录”示例应用程序,使用不同技术堆栈,不同的框架,和不同的后端(REST服务)实现。最新版本包括:

Employee Directory with Backbone.js, RequireJS, and Twitter Bootstrap
Employee Directory with Backbone.js, RequireJS, Topcoat and PhoneGap

对于人们要求的AngularJS版本,在这里。

你可以体验以下的应用程序。

点击这里,可以在一个浏览器中查看运行的这个完整程序。

这个版本,为移动端界面,使用了一个新的 Topcoat CSS框架。


源代码

这个示例的源代码在 GitHub:http://github.com/ccoenraets/angular-directory


数据服务

这个应用使用两种不同的数据服务

内存数据服务(默认)中使用 memory-services.js 以提供没有服务依赖的出箱经验。
REST 数据服务使用 rest-services.js 以提供更加真实的实现。

程序运行在REST服务中:

在您的系统中安装 Node.js 以及 MongoDB
进入 angular-directory/server 目录,运行:

1
npm
install
运行:

1
node
server
在 app.js, 修改:

1
angular.module(
'myApp'
,
[
2
'ngRoute'
,
3
'myApp.controllers'
,
4
'myApp.memoryServices'
5
]).
修改为:

1
angular.module(
'myApp'
,
[
2
'ngRoute'
,
3
'myApp.controllers'
,
4
'myApp.restServices'
5
]).
为了避免一些跨域问题,访问以下URL:

view
source

print?

1
http://localhost:3000
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: