自定义过滤器filter
来源:互联网 发布:软件开发北京 编辑:程序博客网 时间:2024/05/17 09:03
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="angularjs/angular.js"></script>
<script>
var app = angular.module("myApp",[]);
app.controller("myCtrl",function($scope){
$scope.haha = "wozhendeshi ";
});
//调用filter()方法自定义过滤器
app.filter("myFilter",function(){
return function(text){
return text.replace(/hello/,"你好");
}
});
</script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<p>{{haha | myFilter}}</p>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="angularjs/angular.js"></script>
<script>
var app = angular.module("myApp",[]);
app.controller("myCtrl",function($scope){
$scope.haha = "wozhendeshi ";
});
//调用filter()方法自定义过滤器
app.filter("myFilter",function(){
return function(text){
return text.replace(/hello/,"你好");
}
});
</script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<p>{{haha | myFilter}}</p>
</body>
</html>
阅读全文
0 0
- AngularJS 过滤器\自定义过滤器 $filter
- 自定义Filter过滤器
- Django自定义过滤器filter
- lucene自定义过滤器Filter
- 自定义filter(过滤器)
- Lucene - 自定义过滤器Filter
- 《AngularJs》$filter 自定义过滤器
- angularJS filter自定义过滤器
- 自定义过滤器filter
- Angularjs filter过滤器以及自定义filter过滤器
- angularJs-----$filter过滤器使用 自定义过滤器
- angularJs-----$filter过滤器使用 自定义过滤器
- MVC之自定义过滤器(Filter)
- anagular.JS Filter自定义过滤器
- AngularJs基础——过滤器filter及自定义过滤器filter
- 自定义Filter过滤器,过滤所有jsp页面
- yii filter自定义过滤器类的用法
- yii filter自定义过滤器类的用法
- Spring @Transactional原理及使用
- UVa10340
- Codeforces876B-Divisiblity of Differences
- log4j日志配置
- 高精度练习之加法
- 自定义过滤器filter
- android webview 遇到android.os.FileUriExposedException错误
- HTML angular单选按钮
- SQLiteException: not an error (code 0): Could not open the database in read/write mode
- Broadcom BCM94360系列网卡Linux(Ubuntu/Fedora)驱动安装总结
- CNN详解(卷积层及下采样层)
- jmeter测试网站登录
- 子页面与父页面互相调用包括iframe
- js购物车