mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-02 17:26:31 +08:00
28 lines
736 B
Plaintext
28 lines
736 B
Plaintext
@ngdoc error
|
|
@name $parse:isecfld
|
|
@fullName Referencing Disallowed Field in Expression
|
|
@description
|
|
|
|
Occurs when an expression attempts to access one of the following fields:
|
|
|
|
* __proto__
|
|
* __defineGetter__
|
|
* __defineSetter__
|
|
* __lookupGetter__
|
|
* __lookupSetter__
|
|
|
|
AngularJS bans access to these fields from within expressions since
|
|
access is a known way to mess with native objects or
|
|
to execute arbitrary Javascript code.
|
|
|
|
To resolve this error, avoid using these fields in expressions. As a last resort,
|
|
alias their value and access them through the alias instead.
|
|
|
|
Example expressions that would result in this error:
|
|
|
|
```
|
|
<div>{{user.__proto__.hasOwnProperty = $emit}}</div>
|
|
|
|
<div>{{user.__defineGetter__('name', noop)}}</div>
|
|
```
|