This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Documentation for writing a widget is wrong #1021
Closed
Description
The widget example at http://docs.angularjs.org/guide/dev_guide.forms section "Implementing custom form control (using ngModel)" is out of date or just wrong.
The example SEEMS to work, but in reality it doesn't really do data binding correctly. For example of the underlying "content" model changes, the widget will not update (try it).
The issues are:
- the
render
function is actually called$render
now - the
$render
function does not take a parametervalue
, instead it should read the value from$viewValue
This code works better: http://jsfiddle.net/Jju2m/1/