MCPcopy
hub / github.com/textAngular/textAngular / _setViewValue

Function _setViewValue

src/taBind.js:301–317  ·  view source on GitHub ↗
(_val, triggerUndo, skipRender)

Source from the content-addressed store, hash-verified

299 };
300
301 var _setViewValue = function(_val, triggerUndo, skipRender){
302 _skipRender = skipRender || false;
303 if(typeof triggerUndo === "undefined" || triggerUndo === null) triggerUndo = true && _isContentEditable; // if not contentEditable then the native undo/redo is fine
304 if(typeof _val === "undefined" || _val === null) _val = _compileHtml();
305 if(_taBlankTest(_val)){
306 // this avoids us from tripping the ng-pristine flag if we click in and out with out typing
307 if(ngModel.$viewValue !== '') ngModel.$setViewValue('');
308 if(triggerUndo && ngModel.$undoManager.current() !== '') ngModel.$undoManager.push('');
309 }else{
310 _reApplyOnSelectorHandlers();
311 if(ngModel.$viewValue !== _val){
312 ngModel.$setViewValue(_val);
313 if(triggerUndo) ngModel.$undoManager.push(_val);
314 }
315 }
316 ngModel.$render();
317 };
318
319 var _setInnerHTML = function(newval){
320 element[0].innerHTML = newval;

Callers 2

taBind.jsFile · 0.85
fileDropHandlerFunction · 0.85

Calls 1

_compileHtmlFunction · 0.85

Tested by

no test coverage detected