Page 1 of 1

Navigate to pages from html

Posted: Wed Aug 22, 2018 5:24 am
by otlik
Dear Forumers!

I try to put an offcanvas menu to the app with inside app page link (html and js combination), but I don't know how its possible. I tried to replace # with pagename, but no luck.
Anyone can help? Thanks!
Like this:
<ul class="dropdown-menu navmenu-nav">
<li><a href="#">Action</a></li>
</ul>

And I have an error message from fancy checkboxes when I try to define on and off states with variables, what is the problem:
Error: [$compile:ctreq] http://errors.angularjs.org/1.6.10/$com ... 1=ngChange
at W (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular.min.js:76:472)
at p (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular.min.js:71:195)
at f (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular.min.js:62:477)
at f (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular.min.js:62:494)
at p (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular.min.js:71:134)
at f (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular.min.js:62:477)
at f (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular.min.js:62:494)
at Anonymous function (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular.min.js:62:100)
at link (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular-route.min.js:7:408)
at Anonymous function (file:///C:/ProgramData/NeoSoft/NeoAppBuilder/js/angular.min.js:17:108)

Re: Navigate to pages from html

Posted: Thu Aug 23, 2018 3:52 am
by luishp
Use this syntax:
<a href="javascript:angular.element(document.getElementById('ng-view')).scope().GotoPage('PageName')">Action</a>
To simplify I allways define this on Project->Events->Start-up:
BeginJS
AppFunctions = angular.element(document.getElementById("ng-view")).scope();
EndJS
And then you can use NAB functions anywhere from javascript like this:
AppFunctions.GotoPage("PageName");
Or in this case:
<a href="javascript:AppFunctions.GotoPage('PageName')">Action</a>
Regards.

Re: Navigate to pages from html

Posted: Thu Aug 23, 2018 4:11 am
by otlik
Big thanks Luishp!