angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

binding with no {{}} does not work

Open mhevery opened this issue 15 years ago • 4 comments

Consider the example at http://jsfiddle.net/QW5wm/

Both a-tags should link to the same URL. However, "Link B" disregards the ng:href template.

mhevery avatar Aug 24 '11 02:08 mhevery

Why do you want to use ng:href if there is no binding?

Codier avatar Aug 25 '11 17:08 Codier

The issue is that the second link does not work

<a ng:href="#/link{{'1'}}">link A</a><br/>
<a ng:href="#/link1">link B</a>

mhevery avatar Aug 25 '11 19:08 mhevery

I know. A related issue is that ng:check=true will not work as well. Basically, I suspect any directive in the following list will work in the case when you don't have double curly in the expression.

forEach('src,href,checked,disabled,multiple,readonly,selected'.split(','), function(name) { SPECIAL_ATTRS['ng:' + name] = name; });

The code snippet above is from markups.js https://github.com/angular/angular.js/blob/master/src/markups.js

But again. Why do you want to do ng:href="#/link" when you can simply do href="#/link"

Codier avatar Aug 25 '11 20:08 Codier

regardless wether you would want to do this, the expected behavior is that ng:href works like href, and in this case it does not. :-(

mhevery avatar Aug 25 '11 20:08 mhevery