1👍
✅
You need to put the value in quotes.
<div ng-init="supervisor='{{supervision.supervisor}}'">
0👍
Here’s what I ended up doing:
I’ve added a function to the controller scope:
$scope.initialize = function(data){
$scope.supervisor = data;
};
and then I did this in my html template:
ng-init="initialize( '{{supervision.supervisor}}');
And now it works. Hope it help you if you have the same problem!
- Customize related objects for many-to-many field in Django
- Set Django model field by choice text name
- Django REST Framework serializers: readable and kinda writable
Source:stackexchange.com