<html ng-app='app1'>
<head>
<meta name="generator"
content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />
<title></title>
<script src='E:\global\js\angular.min.js'> </script>
</head>
<body>
<div ng-controller="c1">
<input value="get the filter value" type='button' ng-click="getFilter()" />
<div ng-bind="name " ></div>
<div ng-bind="name | f1:'test page'" ng-show="isShow"></div>
</div> <script>
var app=angular.module('app1',[]);
app.controller('c1',['$scope',function($scope){
$scope.name="please input the pw";
$scope.isShow=false;
$scope.getFilter=function(){
$scope.isShow=true;
}
}])
app.filter('f1',function(){
return function(str,filterString){
return str+':custom:'+filterString;
}
})
</script>
</body>
</html>

核心代码

app.filter('f1',function(){
return function(str,filterString){
return str+':custom:'+filterString;
}
})

angular入门--自定义过滤器的更多相关文章

  1. angular之自定义过滤器的使用

    自定义过滤器需要使用filter函数,格式如下: filter("filterName',function(){ return function(target,args){ .... } } ...

  2. Django入门--自定义过滤器与标签

    ---恢复内容开始--- 为了让Django找到自定义的模板过滤器和模板标签,需要进行文件路径配置,配置方式分为APP目录下配置和项目路径下配置两种方式: 1.在APP目录下配置:针对某个应用特定的自 ...

  3. -_-#【Angular】自定义过滤器

    AngularJS学习笔记 <!DOCTYPE html> <html ng-app="Demo"> <head> <meta chars ...

  4. 简述angular自定义过滤器在页面和控制器中的使用

    首先设置自定义过滤器. 定义模块名:angular ? 1 2 3 4 5 6 .module('myApp') .filter('filterName',function(){ return fun ...

  5. angular自定义过滤器在页面和控制器中的使用

    首先设置自定义过滤器. 定义模块名:angular .module('myApp') .filter('filterName',function(){ return function(要过滤的对象,参 ...

  6. Angular——自定义过滤器

    基本介绍 除了使用AngularJS内建过滤器外,还可以根业务需要自定义过滤器,通过模块对象实例提供的filter方法自定义过滤器. 基本使用 (1)input是将绑定的数据以参数的形式传入 (2)i ...

  7. angular自定义过滤器操作实例

    //模块名字var filters = angular.module("customFilter",[]);//过滤器名字filters.filter("uniqueCa ...

  8. angular入门

    angular入门 <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset=&q ...

  9. 秒味课堂Angular js笔记------过滤器

    不同过滤器的小demo. currency number uppercase json limitTo date orderBy filter <script> var filterMy ...

随机推荐

  1. 【转载】有人出天价买他的一个文案标题,今天10min教会你……

    目录 1. 套路 1:新闻社论 2. 套路 2:好友对话 3. 套路 3:实用锦囊 4. 套路 4:惊喜优惠 5. 套路 5:意外故事 本文由 简悦 SimpRead 转码, 原文地址 https:/ ...

  2. MySQL ORDER BY:对查询结果进行排序

    在 MySQL SELECT 语句中,ORDER BY 子句主要用来将结果集中的数据按照一定的顺序进行排序. 其语法格式为: ORDER BY {<列名> | <表达式> | ...

  3. pip安装报错: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy

    pip安装报错 解决办法: pip install selenium -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

  4. LaTeX常用符号(持续更新)

    参考网址:https://qianwenma.cn/2018/05/17/mathjax-yu-fa-can-kao/# 基本运算 1.乘法$x\times y$ x\times y 2.乘法$x^{ ...

  5. ca76a_c++_流文件打开输入输出文件模式p773

    /*ca76a_c++_流文件打开输入输出文件模式利用文件流打开文件进行输入与输出时的选项in.out.app(附加模式).ate((end)文件打开后,定于文件结尾).trunc(裁剪).binar ...

  6. frp多层socks代理+端口映射

    一.首先在公网上配置服务端(frps.ini) [common] bind_addr = xx.xx.xx.xx #公网vps的ip bind_port = 7000   二.配置客户端frpc. i ...

  7. 【django】CMS开发笔记一:虚拟环境配置

    项目代码:https://github.com/pusidun/CMS-django 使用虚拟环境 虚拟环境是Python解释器的虚拟副本.在虚拟环境中安装私有包,不会影响全局的Python解释器.可 ...

  8. thinkphp3.2 where 条件查询

    thinkphp3.2 where 条件查询 在连贯操作中条件where的操作有时候自己很晕,所以整理下,有助于使用 查询条件 支持的表达式查询,tp不区分大小写 含义 TP运算符 SQL运算符 例子 ...

  9. Latex文件本机能正常编译,但在另一台电脑不能编译的解决方法

    问题:同样的文件在台式机能编译出正常的PDF文件,但发现在另一个电脑上不能编译出PDF文件. \documentclass[preprint,10pt,5p,times,twocolumn]{elsa ...

  10. Python 为什么不支持 i++ 自增语法,不提供 ++ 操作符?

    在 C/C++/Java 等等语言中,整型变量的自增或自减操作是标配,它们又可分为前缀操作(++i 和 --i)与后缀操作(i++ 和 i--),彼此存在着一些细微差别,各有不同的用途. 这些语言的使 ...