angularjs - Angular orderBy evaluate expression -


i orderby evaluate expression

currently have:

ng_repeat: "post in posts | orderby:"up_votes" 

i instead order {{up_votes - down_votes}}

ng_repeat: "post in posts | orderby:'down_votes - up_votes'" 

just use single quotes wrap expression orderby

or add votediff function controller , orderby:votediff


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -