This is in continuation to the stakoverflow question below
Set different hyperlink for same <a> tag (Using AngularJs)
I have 2 URLs as shown below. Pre.html and Block.html
<ul class="dropdown-menu">
<li><a ng-model="data" ng-href="{{ data ? 'Pre.html' : 'Block.html' }}" target="_blank">Pre or Bloc</a></li>
</ul>
This basically checks the value of data in the controller and loads Pre.html if $scope.data is true. It loads Block.html if $scope.data is false.
So, with this i am able to achieve the following
1) User clicks on link. User is shown block page if value of 'data' is false at the controller
2) User clicks on link. User is shown pre.html page if value of 'data' is true at the controller.
But when user type the link in URL, he is still able to access the Pre.html even when the $scope.data is set as false.
How can i block this URL access when $scope.data is set as false. > any suggestions