Calling Angular JS function from Hype3


#1

Hey Guys,

do you have an idea how could I call “ng-click” from a Hype scene? Usually in my project we are doing this very simply:

	<button class="button button-block button-positive" ng-click="login()">
	Open PopUp
</button>

Also another side-question:

Is there a way to add a custom class inside of Hype? For example for a button an additional class:

<button class="button button-positive">onklick</button>

Thanks & Cheers!


(Dennis van Leeuwen) #2

Maybe this is what your are looking for:
http://tumult.com/hype/documentation/3.0/#identity-inspector


(Jonathan Deutsch) #3

You can set classes on Hype elements through the Identity inspector as @Bendora showed, but there is no way to set arbitrary attributes at this time. It could also be the case that angular won’t pick them up with how Hype constructs the DOM; that I don’t know too much about.

You might be able to edit the element’s inner HTML (via this menu item) and include angular elements with ng-click that way, although this might also not work immediately. Looking through some stack overflow posts, you may need to manually call $compile for angular to pick up the events. Sorry I don’t have specifics, but maybe that will point you in the right direction. Please feel free to share if you develop any solutions.


#4

Thanks Jonathan, yes I tryed that with the inner HTML. But as you supposed – this is not working immediately. The problem seems to be more complicated than I was hoping :slight_smile: Not sure if I will be able to solve this on my own… Anyhow, if I find out something, will post it here…