Thank you! Your feedback has been delivered
Thank you! Your feedback has been sent

AngularJS Directive

I need AngularJS directive that works like "jQuery.load".
ngInclude works like jQuery.load, however it lack selector function.
(jQuery.load can select a DOM with selector from loaded HTML.)

Please make a directive works like jQuery.load with selector feature.
I'd like do ...

<ng-include src=" 'content.html #partA' "></ng-include>

content.html

<html>
<body>
<div id="partA">content</div>
<div id="partB">content</div>
</body>
</html>
User Gravatar

akazah

Posted May 11 2014 0:51 UTC

$25


  • Assigned To ServA1
  • Solved
  • jquery
    angularjs
  • 720 Views

2 Replies


You can use ui-utils instead of ngInclude for selector support http://angular-ui.github.io/ui-utils/ Look under the title in that page called "Include Fragment"

Usage : <ui-include src="'my/url/to/partial/file'" fragment="'#id-to-fragment'"></ui-include>

Your content.html page should look something like this :

<html><head></head><body>
<fragment-1>Fragment 1</fragment-1>
<fragment-2>Fragment 2</fragment-2>
<fragment-3>Fragment 3</fragment-3>
</body>
User Gravatar

ServA1

Posted May 11 2014 3:55 UTC

Solution

This didn't solve your task? Get your own custom solution.

Thank you!!!

User Gravatar

akazah

Posted May 11 2014 4:28 UTC

Add a reply

By posting a reply on CodersClan you agree to our Terms & Conditions