首页 \ 问答 \ 什么是AngularJS中的状态过滤?(What is stateful filtering in AngularJS?)

什么是AngularJS中的状态过滤?(What is stateful filtering in AngularJS?)

我正在阅读AngularJS开发者指南,并在“过滤器”部分( https://docs.angularjs.org/guide/filter#stateful-filters )中查看“状态过滤器”。

给出了以下描述:

非常不鼓励编写有状态的过滤器,因为它们的执行不能被Angular进行优化,这往往会导致性能问题。 只有将隐藏状态作为模型并将其转换为过滤器的参数,才能将许多状态过滤器转换为无状态过滤器。

我是Web开发的新手,所以不知道什么是状态过滤,Angular文档没有解释它:(有人可以解释一个正常的过滤器和状态过滤器之间的区别是什么?


I was reading the AngularJS developer guide on the Filter section (https://docs.angularjs.org/guide/filter#stateful-filters) and came across "Stateful Filters".

This description is given as follows:

It is strongly discouraged to write filters that are stateful, because the execution of those can't be optimized by Angular, which often leads to performance issues. Many stateful filters can be converted into stateless filters just by exposing the hidden state as a model and turning it into an argument for the filter.

I'm new to web development, so have no idea what Stateful filtering is, and Angular Documentation didn't explain it either :( Can someone please explain what is the difference between a normal filter and a stateful filter is?


原文:https://stackoverflow.com/questions/25877704
更新时间:2023-07-22 14:07

最满意答案

我怀疑你的apache配置没有设置为遵循符号链接。

您需要在Apache配置中启用FollowSymLinks选项。 如果主配置允许您覆盖此选项,也可以在.htaccess文件中启用它。

.htaccess文件放在/var/www/html ,其中包含:

Options +FollowSymLinks

要实现这一点,您需要将正确的DirectoryAllowOverride指令设置为至少Options (如果这是当前值,则All也可以工作)


I suspect your apache config is not set to follow symbolic links.

You need to enable the FollowSymLinks option in your Apache configuration. You can also enable that in a .htaccess file, if the main configuration allows you to override this option.

Place a .htaccess file in /var/www/html, containing:

Options +FollowSymLinks

For that to work, you'll need the correct Directory's AllowOverride directive to be set to at least Options (All would work too, if that's the current value)

相关问答

更多
  • 我怀疑你的apache配置没有设置为遵循符号链接。 您需要在Apache配置中启用FollowSymLinks选项。 如果主配置允许您覆盖此选项,也可以在.htaccess文件中启用它。 将.htaccess文件放在/var/www/html ,其中包含: Options +FollowSymLinks 要实现这一点,您需要将正确的Directory的AllowOverride指令设置为至少Options (如果这是当前值,则All也可以工作) I suspect your apache config is ...
  • 确保提供“jquery-1.6.4.js”的路径。 检查src / scripts。 如果它在那里你应该包括它有点像这样,“〜/ src / scripts / jquery-1.6.4.js”。 假设你有“src”文件夹,其中存在“script”文件夹,其中包含你的jquery文件。 Latest version of angular-cli(angular-cli: 1.0.0-beta.19-3) provides an assets folder under src directory. You j ...
  • 经过深入研究后,我发现JBoss AS7实际上并不支持YET MyFaces。 其中一位JBoss开发人员回答了以下问题: 你好JBoss团队, 我想知道我是否可以使用MyFaces代替Mojarra作为jsf 实现。 对不起,如果这不是提出这个问题的地方。 谢谢 拉斐尔卡斯特罗 **对于AS7,我们目前无法让您使用MyFaces。 这是在待办事项清单上,但尚未安排发布。 斯坦** 这是该讨论的URL 使用MyFaces代替Mojarra和JBoss AS7 。 因此,您似乎必须使用以前版本的JBoss,例 ...
  • 如果我运行节点脚本/ web-server.js或cd到脚本并运行节点web-server.js而不仅仅是./web-server.js,节点退出时出现错误,无法找到文件web-server.js if I run node script/web-server.js or cd into script and run node web-server.js instead of just ./web-server.js, node exits with an error that it cannot find ...
  • 为了包含一个全局库,你必须在angular-cli.json scripts数组中添加jquery.js文件: "scripts": [ "../node_modules/jquery/dist/jquery.js" ] 之后,如果已经启动,请重新启动ng serve 。 In order to include a global library, you have to add the jquery.js file in the scripts array from angular-cli.json: ...
  • 我认为静态html文件不能用作视图。 请求被转发到视图,即/MeraComputer/WEB-INF/views/index.html ,因为它是静态文件而不是请求处理程序,您可能会收到警告。 应以不同方式处理静态文件。 我认为这是一个类似的帖子,可能有所帮助。 I think static html files won't work as views. The request is being forwarded to the view, i.e. to /MeraComputer/WEB-INF/vie ...
  • 在.net Core中,您需要确保使用静态文件中间件,请参阅静态文件文档以了解如何添加它 - 默认情况下应该在新的.net核心项目中使用。 没有这个中间件,就不会提供静态文件 - 例如。 * .css,*。js,* .html等! In .net Core you need to make sure you're using the static files middleware, please see static files documentation to see how to add this - ...
  • 由于您的项目已经拆分了您的webpack配置,因此需要将这些配置合并到webpack以了解您的所有参数。 最简单的方法是使用lodash中的_.merge方法,详见: https ://lodash.com/docs/4.16.4#merge 首先安装lodash依赖项: npm install --save-dev lodash 然后你合并你的配置,你的webpack.config.js应该是这样的: var path = require('path'); var webpack = require(' ...
  • 作为一个循环工作,我在RequestMapping注释中添加了Angular Routes,并将它们全部指向index.html : @RequestMapping({"/login", "/logout"}) public String index() { return "index.html"; } 编辑:作为一个更好的工作,您可以使控制器实现ErrorController ,覆盖getErrorPath方法,然后添加/error的映射,它将作为一个全能(或映射缺失)方法。 @Controller p ...
  • 有2个地方可以找到问题: httpd.conf,.htaccess - 都是apache web服务器配置文件。 301重定向(如果您之前使用过任何重定向)。 如果你有,你将无法访问你的根URL,除非你清除浏览器URL路由缓存(例如,清除chrome上的浏览器数据没有帮助)。 怎么做 - 取决于您的浏览器。 要阅读有关该主题的更多信息,请访问http://getluky.net/2010/12/14/301-redirects-cannot-be-undon/ There are 2 places to l ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)