Angular 有哪些未公开的特性? [英] What are the undocumented features of Angular?

查看:31
本文介绍了Angular 有哪些未公开的特性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Angular 文档缺少一些东西.有人可以总结一下未记录的功能是什么吗?

The Angular documentation is missing a few things. Can someone summarize what the undocumented features are?

推荐答案

Angular 1.0.5 和 1.0.4:

  • Scope 有两个有用的未记录属性:
  • Scope has two useful undocumented properties:
  1. $parent - 可以用作绑定到父作用域中的原始属性的技巧 - 例子
  2. $$phase - 可用于确定 $digest 是否已在进行中 - 请参阅 this所以答案
  1. $parent - can be used as a hack for binding to a primitive property in a parent scope - example
  2. $$phase - can be used to determine if a $digest is already in progress - see this SO answer

  • ng-switch 有一个未记录的更改 接受表达式的参数(example plnkr)
  • select 有一个未记录的 ng-change 接受表达式的参数
  • 属性 有一个未记录的 $观察 方法(虽然在指令页面上有提到)
  • $cacheFactory 有两个未公开的方法(示例小提琴)

  • ng-switch has an undocumented change parameter that accepts an expression (example plnkr)
  • select has an undocumented ng-change parameter that accepts an expression
  • Attributes has an undocumented $observe method (although it is mentioned on the Directives page)
  • $cacheFactory has two undocumented methods (example fiddle)

    1. get()
    2. info()

  • $location 服务有两个未记录的事件

  • the $location service has two undocumented events

    1. $locationChangeStart(evt, newUrl, oldUrl)(示例)
    2. $locationChangeSuccess(evt, newUrl, oldUrl)(另见 $locationChangeSuccess 和 $locationChangeStart 之间有什么区别?)
    1. $locationChangeStart(evt, newUrl, oldUrl) (example)
    2. $locationChangeSuccess(evt, newUrl, oldUrl) (see also What's the difference between $locationChangeSuccess and $locationChangeStart?)

  • 使用带有 input type="radio" 的 ng-value(未记录),参见 Disqus 评论在 API 文档中
  • use ng-value (undocumented) with input type="radio", see Disqus comment in API docs
  • 这篇关于Angular 有哪些未公开的特性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆