Simple href angular ionic not working

This is a simple href, which is not working in Angular with ionic. No console errors.

<label class="item item-input item-stacked-label" style="text-align:center">           
  <a class="button button-outline button-positive" href="#/app/nutrition" style="width:300px;">
     SUBMIT
  </a>
</label>

Upvotes: 0

Views: 1758

Answers (4)

Nithya
Nithya

Reputation: 52

Use ui-sref in place of href.

<label class="item item-input item-stacked-label" style="text-align:center">           
      <a class="button button-outline button-positive" ui-sref="app.nutrition" style="width:300px;">SUBMIT 
      </a>
</label>

Upvotes: 0

Solved this using button instead of a:

$state.go("app.formulareport");

Called the above line in ng-click attached to the button.

Upvotes: 2

Tomislav Stankovic
Tomislav Stankovic

Reputation: 3128

Replace <a> element with <button> and this should work.

Sometimes, there's a problem with <label> element that should be changed to <div>.

Upvotes: 0

Manik Mahajan
Manik Mahajan

Reputation: 69

instead of:

href="#/app/nutrition"

use:

href="app/nutrition"

Upvotes: 0

Related Questions