Page 1 of 1

Using an appery component as an anchor in the AngularJS / Ionic framework

Posted: Fri Jul 15, 2016 1:53 am
by Samuel Jacob O'Connell

Hi, I'm using the AngularJS / Ionic framework.

My associate has asked the following question --

I have a card with two card items inside. The first is set to an avatar item style and the second is for content. I have a button inside the card which, when clicked, expands the content inside of the card and therefore makes it a lot taller. A second click of the button hides that content so the card returns to it's normal height. However, since the card became taller when expanded, when I click the button the top of the card usually tends to now be off-screen.

What I'd like to do is place an anchor inside of the top part of the card, so that when I click the button it can act as an anchor link and jump me back up to the top. Sounds simple, I'm just confused on how exactly to implement an anchor link in the framework. I tried applying an ng-href to the button: #class_of_top_item, but it didn't work.

We were directed to the following link: http://stackoverflow.com/questions/14...

This link provided the following code:
[url=http://#top]Top[/url]
[url=http://#middle]Middle[/url]
[url=http://#bottom]Bottom[/url]

...

...

The issue is: rather than linking to #top we are trying to link to an appery component.
Would I do #componentname or #class? Or something else entirely?
Any help would be much appreciated!
-Sam


Using an appery component as an anchor in the AngularJS / Ionic framework

Posted: Fri Jul 15, 2016 7:32 am
by Serhii Kulibaba

Hello,

There are no such default functionality, but you are able to add a component HTML to any another component, and use there an anchor


Using an appery component as an anchor in the AngularJS / Ionic framework

Posted: Tue Jul 19, 2016 7:58 pm
by Samuel Jacob O'Connell

Thanks for the help Sergiy.

That does not seem to have worked, but I will keep researching other methods.

:)
-Sam