
angularjs
iteye_13003
这个作者很懒,什么都没留下…
展开
-
React实现Angularjs ng-show、ng-if和ng-hide
添加一段用户登录场景,登录显示登录信息,否则显示非登录信息。使用Angularjs我们可以这样做:<div class="logined" ng-show="isLogin">登录了</div><div class="logined" ng-if="isLogin">你好,{userName}</div>原创 2016-01-07 15:41:07 · 343 阅读 · 0 评论 -
React实现Angularjs ng-class
首先设定一段Angularjs代码的ng-class:<i class="header-help-icon down" ng-class="{up:showMenu}"></i> 比较容易理解的Angularjs ng-class设置样式代码,那我们使用React怎么去实现它呢?// 首先在state设置一个变量比如: isShowLoginMenu,在...原创 2016-01-07 15:30:55 · 360 阅读 · 0 评论 -
Angularjs在线教程 全网发布 邀您共享
http://each.sinaapp.com/angular/技术分享:angular在线教程百度搜索:angular在线教程谷歌搜索:angular在线教程AngularJS在线教程1、AngularJS入门教程:启用应用(app)2、AngularJS入门教程:数据双向绑定(model)3、AngularJS入门教程:模块(module)4、A...原创 2015-10-27 17:59:35 · 181 阅读 · 0 评论 -
Angularjs 双重循环获取父级下标$index
<table class="table table-bordered"> <tr ng-repeat="info in ttzInfo" ng-cloak> <td class="col-xs-2 adjust-col-2 text-right title-desc" ng-bind="info.title"&a原创 2015-09-09 17:00:42 · 773 阅读 · 0 评论 -
Angularjs同步操作http请求with $promise
// Define a factoryapp.factory('profilePromise', ['$q', 'AccountService', function($q, AccountService) { var deferred = $q.defer(); AccountService.getProfile().then(function(res) {...原创 2015-07-02 15:49:56 · 662 阅读 · 0 评论 -
AngularJs $scope function and Filter 异同
首先我们看这样一个实例:// Filtersl.filter('titleFilter', function() { return function(title, id) { var url = '/public/article#/' + id; return '<a href="' + url + '">' + title + '<...原创 2015-02-05 10:35:55 · 167 阅读 · 0 评论 -
AngularJs $stateProvider 链表循环追加实现参数化
Lib: https://github.com/angular-ui/ui-router 使用实例:// Some state name examples// stateName can be a single top-level name (must be unique).$stateProvider.state("home", {});// Or it ca...原创 2015-02-04 17:17:28 · 484 阅读 · 0 评论 -
Angularjs ng-selected 高端用法,针对json list
$scope.updateForm = {id: 33, code: "subwayLine2", name: "川沙"}<select class="form-control" ng-model="updateForm.code"> <option value="">--请选择--</option>原创 2015-01-02 21:32:30 · 266 阅读 · 0 评论 -
Angularjs ng-options循环json数据问题及解决方案
1、数据 [{"code":"subwayLine1"},{"code":"subwayLine2"},{"code":"subwayLine3"},{"code":"subwayLine4"},{"code":"subwayLine5"},{"code":"subwa原创 2015-01-02 20:36:41 · 418 阅读 · 0 评论 -
Angularjs / js 正则格式化银行卡号
app.filter('splitNumberFilter', [function() { return function(content) { return content ? content.replace(/\s/g,'').replace(/(\d{4})(?=\d)/g,"$1 ") : content; }}]); // j...原创 2014-12-31 18:28:50 · 283 阅读 · 0 评论 -
AngularJs 禁止用户输入input,阻止事件运行
<div class="form-group"> <lable class="add-on">证件类型</lable> <span class="right-add-on sl-icon-mobile-lock"></span>原创 2014-12-29 14:27:22 · 1266 阅读 · 0 评论 -
AngularJs 阻止事件运行,防止冒泡穿透事件
<body ng-controller="MainCtrl"> <div ng-click="goUrl('http://qiaole.sinaapp.com')"> <button type="button" ng-click="doSomeSth();$event.stopPropagation();">button&a原创 2014-12-24 10:52:58 · 705 阅读 · 0 评论 -
AngularJs 绑定html数据 ng-bind-html
1、内部域直接信任<div ng-bind-html="preview_data.preview.embed.htmlSafe"></div> myApp.controller('myCtrl', ['$scope', '$sce', function($scope, $sce) { $scope.preview_data.preview.em...原创 2014-12-19 11:01:04 · 350 阅读 · 0 评论 -
【更新】AngularJs $location获取url参数
// 带#号的url,看?号的url,见下面url = http://qiaole.sinaapp.com?#name=cccccc$location.absUrl();// http://qiaole.sinaapp.com?#name=cccccc$location.host();// qiaole.sinaapp.com$location.port()...原创 2014-11-12 14:36:27 · 392 阅读 · 0 评论 -
angularjs获取nodejs response数据的两种方法
第一种解决方案:Nodejs服务端:router.get('/list', function(req, res) { employeeService.queryData(function(data) { var v = _.clone(mapping.employeeList); v.list = data; res.render(ma...原创 2014-11-04 18:07:16 · 651 阅读 · 0 评论 -
AngularJs directive使用自定义filter
/** * money formatter, will add <small> tag for the yuan and the decimal * <div ng-bind-html="number|slMoney [:shrink [:noHtml :decimalLength]]"></div> ...原创 2014-10-09 15:04:53 · 199 阅读 · 0 评论 -
AngularJs 三目运算 表达式判断
事件回顾:由于需要修改同一个模板,里面包含2个不同的内容,第一个里面使用的时间差和第二个里面名称不一样,其他过滤器,内容都大同小异。希望杜绝If这样比较傻的来判断if-show or not,继续追究其源码。var b = "{{", a = "}}"; this.startSymbol = function(a) { return...原创 2014-09-10 14:53:19 · 2524 阅读 · 0 评论