# Problem Linking to an external template (hyperlink)

**URL:** <https://forum.ionicframework.com/t/problem-linking-to-an-external-template-hyperlink/18654>\
**Category:** ionic-v1\
**Created:** [March 6, 2015, 3:06am UTC](https://forum.ionicframework.com/t/problem-linking-to-an-external-template-hyperlink/18654 "2015-03-06T03:06:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iank](https://avatars.discourse-cdn.com/v4/letter/i/ecd19e/32.png) [@iank](https://forum.ionicframework.com/u/iank)\
**Post date:** [March 6, 2015, 3:06am UTC](https://forum.ionicframework.com/t/problem-linking-to-an-external-template-hyperlink/18654/1 "2015-03-06T03:06:11Z")

</div>

hello Everyone  
Please help , what am i missing I have a problem linking to an external template in a tab view. Every other templates are working fine from the tabs. But now i just want to hyperlink a text or button to an external template.

Html code to link to another external template

```
<button class="button button-icon icon " href="/templates/addreceipe.html">
        Add item
    </button>

```

here is my directive

.state(‘addreceipe’, {  
url: “/myreceipes/:addreceipe”,  
views:{  
‘myreceipes’: {  
templateUrl: ‘templates/addreceipe.html’,  
controller: ‘AddItemCtrl’  
}  
}  
});

controller is:

```
.controller('AddItemCtrl', function($scope) {});

```

Please what am I missing here, i cant seam to link this button to the template in templates folder  
@mhartington @Calendee @Ionic  
Thanks Everyone

---

<div class="post-metadata">

**Author:** ![bengtler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bengtler/32/98565_2.png) [@bengtler](https://forum.ionicframework.com/u/bengtler)\
**Post date:** [March 6, 2015, 8:18am UTC](https://forum.ionicframework.com/t/problem-linking-to-an-external-template-hyperlink/18654/2 "2015-03-06T08:18:01Z")

</div>

thats not working…  
you can link a “state”.

you called a state “directive” what is wrong… a directive is something like a dom-component which transforms the dom or is wokring with a dom-element

if you want to link another view you have to linkthe state

```
<button class="button button-icon icon " ui-sref="addreceipe({addreceipe: HERE YOURE ADDRECEIPE PARAMETER VALUE})">
    Add item
</button>

```

or

```
<button class="button button-icon icon " ng-href="/myreceipes/YOURPARAMETERHERE">
    Add item
</button>

```

Please do not use href in angularjs… use ng-href:  
[https://docs.angularjs.org/api/ng/directive/ngHref](https://docs.angularjs.org/api/ng/directive/ngHref)

or ui-sref from ui-router

> **[angular-ui/ui-router](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref)**
>
> ui-router - The de-facto solution to flexible routing with nested views in AngularJS

---

<div class="post-metadata">

**Author:** ![iank](https://avatars.discourse-cdn.com/v4/letter/i/ecd19e/32.png) [@iank](https://forum.ionicframework.com/u/iank)\
**Post date:** [March 11, 2015, 8:46am UTC](https://forum.ionicframework.com/t/problem-linking-to-an-external-template-hyperlink/18654/3 "2015-03-11T08:46:55Z")

</div>

Thanks a million, let u know if i fail or succeed, Ionic is great. Great!!! Support.
