public void Link(Scope scope, jElement el, Attributes attrs, NgModelController ngModel) { dynamic element = el; if(ngModel==null) return; // do nothing if no ng-model // Write data to the model Action read = ()=> { var html = element.html(); // When we clear the content editable the browser leaves a <br> behind // If strip-br attribute is provided then we strip this out string stripBr = attrs["stripBr"]; if( stripBr!="" && html == "<br>" ) html = ""; ngModel.setViewValue(html); }; // Specify how UI should be updated ngModel.render = ()=> { element.html(_sce.getTrustedHtml(ngModel.viewValue)); }; // Listen for change events to enable binding element.on("blur keyup change", (Action) delegate() { scope.Apply(read); }); read(); // initialize }
public void Link(Scope _scope, jElement iElement, Attributes iAttrs, AccordionController acontroller) { ExpanderController ctrl = _scope.ControllerAs<ExpanderController>("ccc"); ctrl.accordionController = acontroller; ctrl.accordionController.addExpander(ctrl); }
public void Link(Scope _scope, jElement elem, Attributes attrs) { elem.bind("blur",(ev)=> { _scope.Apply<string>(attrs["todoBlur"]); }); }
public void Link(Scope _scope, jElement elem, Attributes attrs) { _scope.Watch<bool>(attrs["todoFocus"], (newValue, oldValue) => { if(newValue) { timeout.Set( ()=>{ elem[0].Focus(); }, 0, false); } }); }
/// <summary> /// Prepend content to the beginning of each element of the matching elements. /// </summary> /// <param name="content">The jElement containing the content.</param> /// <returns>The current jElement</returns> public jElement prepend(jElement content) { return null; }
/// <summary> /// Sets the HTML content of the matched set of elements to the markup represented /// by the specified element. /// </summary> /// <param name="html">The new HTML to set.</param> /// <returns>The current jElement.</returns> public jElement html(jElement html) { return null; }
/// <summary> /// Returns a new jElement with descendents of each matched element filtered /// by the specified matched set of elements. /// This traverses down multiple levels of the tree. /// </summary> /// <param name="elements">The matched set of elements to lookup.</param> /// <returns>The new jElement.</returns> public jElement find(jElement elements) { return null; }
/// <summary> /// Insert content after each element of the matching elements. /// </summary> /// <param name="content">The jElement containing the content.</param> /// <returns>The current jElement</returns> public jElement after(jElement content) { return null; }
/// <summary> /// Wraps a jElement around each of the matched set of elements. /// </summary> /// <param name="element">A jElement specifying the structure.</param> /// <returns>The current jElement.</returns> public jElement wrap(jElement element) { return null; }
/// <summary> /// Replace each element in the set of matched elements with the new content provided /// by the specified set of matched elements. /// </summary> /// <param name="content">The object containing the HTML to use.</param> /// <returns>The current jElement.</returns> public jElement replaceWith(jElement content) { return null; }