- 博客(31)
- 收藏
- 关注
转载 angular中cookies的用法
AngularJs中对cookies的操作进行了单独的封装,首先需要先引入angular-cookies.js文件;<script src="scripts/lib/angular-cookies/angular-cookies.js"></script>然后依赖注入到项目中angular.module('site.design', [...
2018-06-02 17:18:00
666
转载 Transitions - UI-Router 路由监听
ui-router提供了一个transition转换对象,transition.to()代表已激活的状态,transition.from()代表过去处于激活的状态;使用transition.params('to')代表已激活状态的路由参数详情;使用transition.params('from')代表过去处于激活状态的路由参数详情;转载于:https://www.cnb...
2018-04-25 15:09:00
148
转载 $state.go reload 强制刷新
$state.go("index.task.selection.log", {pageNo: "1"}, {reload: true}) //reload:true 跳转页面后强制刷新代码 转载于:https://www.cnblogs.com/ncloud/p/8888715.html
2018-04-20 10:19:00
671
转载 angular中$transitions.onSuccess监听路由变化
.run(["$transitions",function ($transitions, $state) { $transitions.onSuccess({}, function (transition) { var currentRoute = transition.to().name; if (currentRoute.indexO...
2018-04-20 10:14:00
809
转载 回车键搜索功能
ng-keyup="$ctrl.enterKeySearch($event)" self.enterKeySearch = function (e) { var keycode = window.event ? e.keyCode : e.which; if (keycode == 13) {...
2018-04-20 09:43:00
260
转载 indexOf()返回首次出现位置,splice() 方法向/从数组中添加/删除项目
indexOf():http://www.w3school.com.cn/jsref/jsref_indexOf.aspsplice():http://www.w3school.com.cn/jsref/jsref_splice.asp转载于:https://www.cnblogs.com/ncloud/p/8134946.html
2017-12-28 11:50:00
172
转载 bootstrap下拉菜单插件
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>Bootstrap 下拉菜单</title> <link rel="stylesheet" href="http://cdn.static.runoob.com/libs...
2017-12-23 19:03:00
68
转载 AngularJs中$timout和$interval和计时器功能
//首先需要依赖注入angular.modal('myApp').component('', { controller:['$interval', '$timeout', function ($interval, $timeout) { var timer = $interval(function () { ...
2017-12-19 16:29:00
107
转载 new Date():时间的获取和转换
new Date()获取系统当前时间:var currentTime= new Date().getYear();//获取当前年份(2位)var currentTime= new Date().getFullYear();//获取当前完整年分(4位)var currentTime= new Date().getMonth();//获取当前月份(0~11,0代表1月)v...
2017-12-11 11:06:00
800
转载 angular.formJson字符串对象转换为对象
例如:var data=“{“value”:0,“value”:1,“value”:2,“value”:3}”//对象字符串;var data=angular.fromJson(data) //用angular.fromJson将变量data转换为对象;转换之后的结果为var data={“value”:0,“value”:1,“value”:2,“v...
2017-11-30 17:18:00
392
转载 angularjs中form表单提交验证
angular.module("MyApp",["ngMessages"]);<form name="formMyName" ng-submit="$ctrl.changePassword(formMyName)" ng-cloak novalidate> <--输入新密码--> <md-input-container md-no...
2017-11-25 09:56:00
229
转载 ng-style和ng-class的应用
ng-style="{设置样式的条件?‘条件成立时的样式’:‘条件不成立时的样式’}"例如:ng-style="{color:a>b?red:blue}"当a>b时颜色为红色;当a<b或a=b;条件不成立时,颜色为蓝色ng-class="{'条件为true时的class样式':条件=true,'条件为false时的class样式':条件=fa...
2017-11-07 16:22:00
226
转载 window.localStorage运用
window.localStorage.getItem('键');//getItem获取浏览器localStorage保存的键的值;window.localStorage.setItem('键','值');//setItem保存键的值到浏览器的localStorage;转载于:https://www.cnblogs.com/ncloud/p/77823...
2017-11-04 10:23:00
136
转载 angular-filter中join/unique属性运用
join属性:例如:数组name=['John', 'Sebastian', 'Will', 'James'];若是想把数组中的对象全部筛选并显示出来,可以直接在HTML里面运用angular-filter中的join属性;用法<p>{{ names | join:', ' }}</p>name为数组名称,join:','显示数...
2017-10-28 09:49:00
124
转载 三目运算符
三目运算符在HTML里面的运用<p>(a<b)?a:b</p>//当a<b条件成立时,也就是a<b为true时显示a的值,//当a<b条件不成立时,也就是a<b为false时显示b的值。相当于if..else..语句;if条件为true时结果为a,为false为b。 转载于:https...
2017-10-28 09:41:00
124
转载 ui-sref的用法
js示例: { name: 'database.list.data.task', url: '/task/{option}/{pageNo}/{pageSize}', params: {option: 'import', pageNo: '1', pageSize...
2017-10-26 11:52:00
1654
转载 forEach的用法
数组.forEach(function(item,index){ })//forEach循环数组,item为循环数组中的每个对象,index为循环每个对象的位置。 转载于:https://www.cnblogs.com/ncloud/p/7735988.html...
2017-10-26 11:39:00
92
转载 filterFilter用法
angular.module('myApp').factory('', [ 'filterFilter',//必须依赖注入 function (filterFilter) { var 变量=filterFilter(数组,{筛选条件},true) }定义一个变量,filterFilter需要筛选的数组。转载于:https...
2017-10-26 11:30:00
106
转载 angular.copy()克隆数据
angular.copy()可以复制一个对象或数组.使用方法:data = self.data = angular.copy(self.currentTemplate);复制self.currentTemplate并赋值给data;转载于:https://www.cnblogs.com/ncloud/p/7553611.html...
2017-09-19 19:28:00
305
转载 angularjs中是否选择所有和$filter过滤orderBy排序
HTML代码:<table class="table table-bordered table-list table-striped no-margin-bottom"> <thead> <tr> <th>{{'column-name' | translate}}</th> ...
2017-09-18 18:45:00
161
转载 ng-sortable拖拽拉取效果
ng-sortable拖拽拉取效果demo地址:https://github.com/a5hik/ng-sortable引入相关的js代码:bower install ng-sortable -save引入js,引入css样式;<script type="text/javascript" src="dist/ng-sortable.min.js"></s...
2017-09-14 21:06:00
215
转载 ng-disabled控制按钮是否可点击
1 <div class="edit-template-column" style="padding-bottom: 15px;" 2 ng-if="!$ctrl.displayMore && $index<0||$ctrl.displayMore"> 3 <span class="margin-right-12"&...
2017-09-14 20:30:00
244
转载 ng-if展开收起列表
用ng-if判断当displayMore值为false时列表状态为收起状态,显示的按钮为展开按钮;当displayMore的值为true时列表状态为展开状态,显示的按钮为收起按钮;html代码: 1 <div class="edit-template-column"> 2 <div layout="row" layout-align="spa...
2017-09-14 16:29:00
174
转载 upload上传文件
上传Excel文件代码demo:下载上传js文件:bower install ng-file-uploa;引入js文件;angular.module('dc.workflow', [ 'ngFileUpload']);js代码:var data=this.data={file:null};//定义data.file为空;this.selectImage = functi...
2017-09-14 11:33:00
108
转载 css新属性
css3引入的“vw”和“vh”基于宽度高度相对于窗口大小,“vw”=“view width”,“vh”=“view hight”;.demo { width: 100vw; font-size: 10vw; /* 宽度为窗口100%, 字体大小为窗口的10% */}.demo2 { width: 80vw; font-size: 8vw...
2017-08-29 21:00:00
53
转载 css3选择器
":first-child"选择父元素下的第一个子元素。列: ol > li :first-child{color:red;} ol元素中的第一个li元素内容设为红色;":last-child" 选择父元素的最后一个子元素。列: ul > li :last-child{background:blue;} ul列表中的最后一个li元素背景设为蓝色;":nth-ch...
2017-08-09 10:56:00
63
转载 自定义filter
js代码:.filter('currentCityFilter'(名称), [function () { return function (city,(city第一个参数对应currentCity值;名称可以不一样) cityList,(第二个参数) three(第三个参数)) { if (city.id == 104) { return cit...
2017-07-20 18:06:00
75
转载 $filter中的date来格式化时间
html中用法:{{ date_expression | date : format : timezone}}参数:format为设置的日期格式,例如:'yyyy-MM-dd' timezone被用于格式化时区。实例:<span>{{1288323623006 | date:'medium'}}</span><br><...
2017-07-20 10:20:00
424
转载 字符串转数组
字符串转数组:getShowColumnId = $filter('split')(getShowColumnId, ',');数组转字符串:getShowColumnId = $filter('join')(getShowColumnId, ',');字符串转换数字:var currentVideoId = parseFloat(要转换的字符串);转载于:https://www.c...
2017-06-22 21:17:00
84
转载 DC项目:localStorage保存 本地保存浏览器
var columnId = self.currentTable.ListColumn.filter(function (item, index) { return index < 8}).map(function (column) { return column.Id});window.localStorage.setItem/*设置*/('show-column...
2017-06-22 17:58:00
173
转载 传递参数,封装函数
.run(['$rootScope', function ($rootScope) { $rootScope.alert = function (textContent(参数), toastClass, hideDelay) { $mdToast.show( $mdToast.simple() .te...
2017-04-26 15:08:00
365
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人