javascript - AngularJS | How to combine ng-dblclick and ng-routing on the same element? -


in app have index.html there ng-view directive. inside directive add information main.html defalut - it's table of names , links. clicking link content of ng-view updates , information particular link link.htmlappears. please, see index.html:

<!doctype html> <html lang="en" ng-app="app"> <head> ... </head> <body ng-controller="myctrl">     <h1>angularjs</h1>     <ng-view></ng-view> </body> </html>  

my main.js:

angular     .module('app', ['ngroute'])     .config(function($routeprovider) {         $routeprovider             .when('/', {                 templateurl: 'partials/main.html'             })             .when('/link/:id', {                 templateurl: 'partials/circle.html',                 controller: 'linkctrl'             })             .otherwise({                 redirectto: '/'             })     })     .controller('myctrl', function($scope) {         $scope.obj = [             {name: "aaa", link: "000"},             {name: "bbb", link: "111"},             {name: "ccc", link: "222"}         ];         $scope.clickfunc = function() {             alert('im doubleclicked');         };     })     .controller('linkctrl', function($scope, $routeparams) {         $scope.id = $scope.obj[$routeparams.id];     }); 

here main.html:

<h2>information</h2> <table>     <thead>     <tr>         <td>name</td>         <td>link</td>     </tr>     </thead>     <tbody>     <tr ng-repeat="link in obj">         <td>{{ link.name }}</td>         <td><a href="#/link/{{ $index }}" ng-dblclick="clickfunc()">{{ link.link }}</a></td>     </tr>     </tbody> </table> 

and here link.html:

<p>welcome new link {{ id }}</p> <a href="#/">back home</a> 

i need able double click same link. question how because adding ng-dblclick directive doesn't work. there way make possible? i've seen here similar question didn't see answer. thank in advance!


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -