angularjs - Why does the following URL return $santize:badparse -
i need fire ng-click when bind following
<a href='#' ng-click ='gotourl('www.cnn.com')'>cnn</a>
i $santize:badparse
what doing wrong?
see this.
http://jsfiddle.net/jigardafda/08k1ztsa/1/
js
var myapp = angular.module('myapp', []); myapp .controller('myctrl', function($scope){ $scope.gotourl = function(url){ window.open(url); }; });
html
<div ng-app="myapp"> <div ng-controller = "myctrl"> <a href='#' ng-click ='gotourl("http://www.cnn.com")'>cnn</a> </div> </div>
Comments
Post a Comment