jamesT
jamesT

Reputation: 111

data-ng-click not responding

This one stumps me..

I have a hyperlink that uses ng-click on a page that loads multiple custom directives, plus other code. I set up the hyperlink but it will not respond.

As a test on another page that calls a custom directive and it failed to respond.

I checked console and had zero errors..

This should work no problem. I've included just the call and the last directive element on the page.

    <div class="defaultPlusFont">Numbers denote the suggested steps to create a <a href="" data-ng-click="$scope.showDetails()">Career Path</a></div>
        <br/>....

  ....

   <div class="col-md-12 col-md-offset-0 col-sm-12 col-sm-offset-0">
                <user-security-questions userId="vm.userId"></user-security-questions>
   </div>  



$scope.showDetails = function(){
            //function showDetails() {
                var modal = $uibModal.open({
                    templateUrl: '/app/templates/modals/showDetails.html',
                    controller: 'showDetailsModalController as vm',
                    size: 'sm',
                    animation: true,
                    windowClass: 'pull-top',
                    windowTopClass: 'slide-from-top',
                    resolve: {

                    }
                });
                modal.result.then(function (result) {
                }, function () {

                });
            }

Everything else works, all the hyper links and directives.. using $scope instead of vm for this function was a last attempt to see what went wrong.

Thanks in advance

Upvotes: 0

Views: 58

Answers (1)

Tilak
Tilak

Reputation: 81

Are you saying that the showDetails function is not called?

If yes, try using :

<a href="" data-ng-click="showDetails()">

I removed the "$scope" from the ng-click. Hope that helps

Upvotes: 1

Related Questions