title: AngularJS, how to bind a variable to concatenation of two other bound variables?
body: <p>I am new to AngularJS and trying to build an AngularJS practice app, in which, the user will concatenate a url from multiple inputs, i.e. protocol, domain, path, param1, param2, param3... etc.</p>
  
  <p>And the app will create a link to the url:</p>
  
  <pre><code>&lt;a&gt;{{protocol}}://{{domain}}{{path}}?{{param1}}&amp;{{param2}}&amp;{{param3}}&lt;/a&gt;
  </code></pre>
  
  <p>Above url is used twice. Once on the href attribute, as well as the actual text. Now what I want to do is something like:</p>
  
  <pre><code>&lt;a href="{{url}}"&gt;{{url}}&lt;/a&gt;
  </code></pre>
  
  <p>But I am not sure where to assign url.
  I tried below, and it worked, but doesn't seem correct.</p>
  
  <pre><code>&lt;a href='{{url = protocol+"://"+domain+path+"?"+param1+"&amp;"+param2+"&amp;"+param3}}'&gt;{{url}}&lt;/a&gt;
  </code></pre>
  
  <p>Assuming that <code>url</code> is used many times in the app, where would be the most appropriate place to assign <code>url</code>?</p>