Answer the question
In order to leave comments, you need to log in
What does $parse.assign do in angular?
I decided to sort out the library with the checker directive
and immediately questions
function postLinkFn(scope, elem, attrs) {
$compile(elem)(scope);
var getter = $parse(attrs.checklistModel);
var setter = getter.assign;
Answer the question
In order to leave comments, you need to log in
https://docs.angularjs.org/api/ng/service/$parse
var getter = $parse('user.name');
var setter = getter.assign;
var context = {user:{name:'angular'}};
var locals = {user:{name:'local'}};
expect(getter(context)).toEqual('angular');
setter(context, 'newValue');
expect(context.user.name).toEqual('newValue');
expect(getter(context, locals)).toEqual('local');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question