Search code examples
angularjstypescripthrefquerystringparameter

How can i append a dynamic angular parameter to an url?


I am working on a project that uses typescript and angularjs. I have to insert the reference to a dynamic link as in the example:

http://..../Detail.aspx?code={{MyCode}} 

where myCode is a dynamic parameter to insert at the end of the URL. How do you advise me to take action? could the use of the ng-href directive help me?


Solution

  • <a href="http://..../Detail.aspx?code={{MyCode}}"> Mylink </a>
    

    will work normally provided MyCode contains value and is within the scope.