angularjs - create "nested" ng-click inside of Angular Directive -


I have an instruction that opens a bootstrap-tour on call to t.start ():

  app.directive ('tourguide', function ($ parse, $ state)) {var directiveDefinitionObject = {restrict: 'e', ​​replace: wrong, link: function (scope, element, ethers) {var T = new travel ({container: $ ("# main"), background: false, debug: true}); T.addStep ({element: "#main", title: "title 123", content: "content 123"}); .int (); T. Start ();}}; Return Directional Definition Object;});  

I want to create a button that can call variable t.start () on click. Is this possible? I want to achieve it so that the controls inside the controllers can be independent, because this instruction will be on every single view of the application, so it would be nice if it can call a parameter inside of it Ive a template in the instructions with a button Attempted to create, and adding a ng-clikc action with t.start () and of course failed because the variable T does not know for controller, where ever my fault For example:

Example:

Let's say that I have 2 IAs, they have 2 interface controllers in the showmax and built-in ITAM. In those scenes I have 1 button / link, on the click I want to show my tourguide thats simple

Now in my tourguide I have 2 different steps, and when I have a button in the CreateItem view I want to see a step in the tour guide for the CreateItem view, and Vise versa

Is it easy if I use the function inside my controller, but is it possible to use only instructions, because I can have 20 different controllers? Based on some assumptions - I believe what you want here to do is call it dynamically in regular radius. An instruction

HTML / view code

  

Controller

 ); }; } {/ Code> 

directive

  app.directive ("myDirective", function () {return {restricted: 'a' Link: function (scope, element, etter) {element.bind ('click', function) (if (type off scope [attr.myDirective] == "function") {scope [attr.myDirective] ();}} );}};});  

In this, you specify the callback routine as part of the instruction. The key to the equation is that the scope of instruction is found in any parent area (balls) which means that you can also make regular calls from the passage of the instructions. To see an example of this work, check out the following plumbers: Hope that helps!


Comments