0

I'm attempting to use a thumbnail grid in my AngularJS application. I've set up a directive for the HTML template part, but am having trouble initializing the jQuery part that expands a tile on click.

I know this is a typical issue when attempting to use jQuery in Angular apps. The jQuery script is very simple, I just don't know how to make it work in Angular. The script:

    <script>
        $(function() {
            Grid.init();
        });
    </script>

Thanks for any advice/help!

Edit: Page is here: tinyurl.com/jgbrpd6. As you can see, if you click on one of the elements, nothing happens because the jQuery script is located in the HTML of the templateUrl file.

templateUrl file is here: tinyurl.com/zr9ylqf. As you can see, if you click on one of the elements, it behaves as expected, becuase it is now outside of the AngularJS app.

Jorgen
  • 1
  • 1
  • This information isn't information.. Have you copied same code? Do you see any console errors? – Guruprasad J Rao Feb 09 '16 at 03:35
  • There are no console errors. To make the plugin work in jQuery, the only script needed is the one I've posted + dependencies, which load fine. – Jorgen Feb 09 '16 at 03:39
  • Did you paste the `javascript` given in the link into a file and included it? – Guruprasad J Rao Feb 09 '16 at 03:43
  • Does not do anything different than including it in a script tag. Just FYI about using jQuery in Angular: http://stackoverflow.com/questions/16935095/correct-way-to-integrate-jquery-plugins-in-angularjs – Jorgen Feb 09 '16 at 04:56
  • Angular does not need `jQuery` as of my knowledge, but am not sure whether you have included your code or not.. Can you create a **[`DEMO HERE`](http://jsfiddle.net)** – Guruprasad J Rao Feb 09 '16 at 05:11

0 Answers0