Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>UPDATE 1</strong> Make sure to go from snake-case to camelCase when going from HTML to javascript in angular. So <code>init-toolbar</code> in html translates to <code>initToolbar</code> in javascript.</p> <p>Here is a working sample: <a href="http://plnkr.co/edit/l2AJmU?p=preview">http://plnkr.co/edit/l2AJmU?p=preview</a></p> <p>HTML</p> <pre><code>&lt;div init-toolbar=""&gt; &lt;p&gt; Hover over me. Hover over me. Hover over me. &lt;/p&gt; &lt;/div&gt; </code></pre> <p>Button.html</p> <pre><code>&lt;div&gt; &lt;button ng-click="someFunction()"&gt;Click me&lt;/button&gt; &lt;/div&gt; </code></pre> <p>JAVACRIPT</p> <pre><code>var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { $scope.name = 'World'; $scope.someFunction = function() { $scope.name = 'FOO BAR'; }; }); app.directive('initToolbar', function($http, $compile, $templateCache){ return { restrict: 'A', link: function(scope, element, attrs) { $http.get('button.html', {cache: $templateCache}). success(function(content) { var compiledContent = $compile(content)(scope); $(element).qtip({ content: compiledContent, position: { my: 'bottom left', at: 'bottom middle', target: $(element) }, hide: { fixed : true, delay : 1000 } }); }); } } }); </code></pre> <p><strong>ORIGINAL</strong></p> <p>The reason the button does not work is because angular does not know it should bind to it. You tell angular to do that using <a href="http://code.angularjs.org/1.1.5/docs/api/ng.%24compile">$compile</a>. I don't know much about that qTip2 pluggin, but if you load the template, then compile it <code>$compile(template)(scope);</code> then hand it over to qTip2, you will get the results you expect.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload