webapp框架—学习AngularUI2(demo改造)
目的:把AngularUI的模板应用到“桂电在线”上
步骤如下:
- 按功能表修改demo界面


- 学习angularUI如何加载全部页面,为了设置自定义加载模板,在demo/demo.js中找到这一段
//当#为/,/scroll等等,请求index.html中<base href=""> + home.html的页面
app.config(function($routeProvider) {
$routeProvider.when('/', {templateUrl: 'home.html', reloadOnSearch: false});
$routeProvider.when('/scroll', {templateUrl: 'scroll.html', reloadOnSearch: false});
$routeProvider.when('/toggle', {templateUrl: 'toggle.html', reloadOnSearch: false});
$routeProvider.when('/tabs', {templateUrl: 'tabs.html', reloadOnSearch: false});
$routeProvider.when('/accordion', {templateUrl: 'accordion.html', reloadOnSearch: false});
$routeProvider.when('/overlay', {templateUrl: 'overlay.html', reloadOnSearch: false});
$routeProvider.when('/forms', {templateUrl: 'forms.html', reloadOnSearch: false});
$routeProvider.when('/dropdown', {templateUrl: 'dropdown.html', reloadOnSearch: false});
$routeProvider.when('/drag', {templateUrl: 'drag.html', reloadOnSearch: false});
$routeProvider.when('/carousel', {templateUrl: 'carousel.html', reloadOnSearch: false});
}); - 继续阅读demo.js的执行脚本
- 拖拽项消失
- 拖拽切换图片
- 主要控制器
- L195 $rootScope.$on('$routeChangeStart', function(){}); 和 L199 $rootScope.$on('$routeChangeSuccess', function(){});学到 用.$on()来绑定事件和改变hash的事件可以触发这里的代码,对比后,发现两个基本方法一样。不同的一点就是 先触发routeChangeStart, 后触发routeChangeSuccess。
- 滚动列表页:滚动栏加载数据 $scope.scrollItems = scrollItems; scrollItems是一个列表数组;滚动到底部事件(需要做下拉刷新)
- 右边聊天侧栏的json数据,显示在线还是不在线,对我来说暂时没有这个能力做聊天功能
- 表单页面
改换原来bootstrap模板
1.由上面步骤2知道页面加载有两个因素决定:
1 base路径 => base_url()
2 hash对应的页面路径 => 控制器/方法
3 隐藏index.php
/config/config.php $config['index_page'] = ''; //L29设置为空
.htaccess
RewriteEngine on
RewriteCond $ !^(lightapp|lightapp\.php|index\.php|public|robots\.txt) #允许lightapp|lightapp.php访问
RewriteRule ^(.*)$ /index.php/$ [L]config.yaml
- rewrite: if( !is_file() && !is_dir()) goto "index.php?%{QUERY_STRING}"
# 如果 url 既不是文件,也不是目录,跳转至 index.php?%{QUERY_STRING} 不能放在cron后面4 修改demo.js中菜单路由
2.替换资源路径<?=__PUBLIC__?>,拷贝2个js,3个css文件
3.新建style,script目录,存放项目的js和css
4.拷贝字体目录fonts到public下
5.拷贝home.html,sidebar.html页面到视图目录下
总结:至此,桂电在线的模板就应用了angularUI。记录一下接下来的开发计划:
1.显示我的菜单 有登录和没登录(注册登录界面)
2.显示学校公告新闻列表,和详情
webapp框架—学习AngularUI2(demo改造)的更多相关文章
- webapp框架—学习AngularUI1(demo折腾)
angularUI下载地址:https://github.com/Clouda-team/BlendUI 下载解压后,demo在根目录 现在测试官网demo的使用 用浏览器打开mobile-angul ...
- RPC框架学习+小Demo实例
一.什么是RPC协议? 全称:远程过程调度协议 效果:使消费者向调用本地方法一样调用远程服务方法,对使用者透明 目前常用:Dubbo.Thirft.Sofa.... 功能: 建立远程通信(socket ...
- 各种demo——CI框架学习
各种demo——CI框架学习 寒假学习一下CI框架,请各位多多指教! 一.CI的HelloWorld! 注意:CI禁止直接通过文件目录来访问控制器. ./application/controlle ...
- 01-Spring Security框架学习--入门(二)
一.入门案例 Spring Security 自定义登录界面 通过之前的一节 01-Spring Security框架学习--入门(一)的简单演示,Spring security 使用框架自带的登录界 ...
- Yii框架学习 新手教程(一)
本人小菜鸟一仅仅,为了自我学习和交流PHP(jquery,linux,lamp,shell,javascript,server)等一系列的知识,小菜鸟创建了一个群.希望光临本博客的人能够进来交流.寻求 ...
- Hadoop Streaming框架学习(一)
Hadoop Streaming框架学习(一) Hadoop Streaming框架学习(一) 2013-08-19 12:32 by ATP_, 473 阅读, 3 评论, 收藏, 编辑 1.Had ...
- Spring框架学习1
AnonymouL 兴之所至,心之所安;尽其在我,顺其自然 新随笔 管理 Spring框架学习(一) 阅读目录 一. spring概述 核心容器: Spring 上下文: Spring AOP ...
- JavaSE中Collection集合框架学习笔记(2)——拒绝重复内容的Set和支持队列操作的Queue
前言:俗话说“金三银四铜五”,不知道我要在这段时间找工作会不会很艰难.不管了,工作三年之后就当给自己放个暑假. 面试当中Collection(集合)是基础重点.我在网上看了几篇讲Collection的 ...
- JavaSE中Collection集合框架学习笔记(3)——遍历对象的Iterator和收集对象后的排序
前言:暑期应该开始了,因为小区对面的小学这两天早上都没有像以往那样一到七八点钟就人声喧闹.车水马龙. 前两篇文章介绍了Collection框架的主要接口和常用类,例如List.Set.Queue,和A ...
随机推荐
- Python Requests库
背景 Requests is an elegant and simple HTTP library for Python, built for human beings. Requests是一个优雅简 ...
- C++ primer(八)--内联函数 引用变量 引用传递函数参数 函数重载/模板/模板具体化
一.内联函数 常规函数和内联函数的区别在于C++编译器如何将他们组合到程序中.编译过程的最终产品是可执行程序--由一组机器语言指令组成.运行程序时,操作系统将这些指令载入到计算机内存中,因此每 ...
- Code Forces 711C Coloring Trees
C. Coloring Trees time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- c#复制图片到粘贴板
string fielN; private void button1_Click(object sender, EventArgs e) { OpenFileDialog saveFileDialog ...
- equals()和hashCode()区别?
equals()和hashCode()区别? ------------------------------------------------- equals():反映的是对象或变量具体的值,即两个对 ...
- centos防火墙操作
centos防火墙基本操作 #/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT#/sbin/iptables -I INPUT -p tcp -- ...
- [Redux] Colocating Selectors with Reducers
We will learn how to encapsulate the knowledge about the state shape in the reducer files, so that t ...
- Context
Context,中文直译为“上下文”,SDK中对其说明如下: Interface to global information about an application environment. Thi ...
- IO负载高的来源定位 IO系列
http://elf8848.iteye.com/category/281637 前言: 在一般运维工作中经常会遇到这么一个场景,服务器的IO负载很高(iostat中的util),但是无法快速的定位到 ...
- MySQL 5.6 SQL 优化及 5.6手册
http://blog.chinaunix.net/uid-259788-id-4146363.html http://www.cnblogs.com/Amaranthus/p/4028687.htm ...