AngularJS supports .wrap() jQuery functionality. Here in below examples we can see how to wrap HTML structure around an element.

Steps to wrap div around an element:

  1. Get angular element of html element
  2. Use .wrap() method to wrap element
var myEl = angular.element( document.querySelector( '#divID' ) );
myEl.wrap('<div></div>');

Steps to wrap element around an element::

  1. Get angular element
  2. Use .wrap(element) method to wrap an element around another element
var myEl = angular.element( document.querySelector( '#divID' ) );
var wEl = angular.element( document.querySelector( '#wrapID' ) );
myEl.wrap(wEl);

0 comments:

Blogroll

Follow this blog by Email

Popular Posts