From 77155458efcd9c6e20515a9305248cace3554084 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Thu, 23 Apr 2015 12:18:51 -0600 Subject: [PATCH] docs(error/nonassign): add optional binding example --- docs/content/error/$compile/nonassign.ngdoc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/content/error/$compile/nonassign.ngdoc b/docs/content/error/$compile/nonassign.ngdoc index 0762eea96c39..8a13fd8574bb 100644 --- a/docs/content/error/$compile/nonassign.ngdoc +++ b/docs/content/error/$compile/nonassign.ngdoc @@ -36,9 +36,25 @@ Following are invalid uses of this directive: ``` -To resolve this error, always use path expressions with scope properties that are two-way data-bound: +To resolve this error, do one of the following options: + +- use path expressions with scope properties that are two-way data-bound like so: + ``` ``` +- Make the binding optional + +``` +myModule.directive('myDirective', function factory() { + return { + ... + scope: { + localValue: '=?bind' // <-- the '?' makes it optional + } + ... + } +}); +```