View/Page override
(Automatically adding template at the end of the page.)
(Replacing message template with parser tag)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<message>Write the content here to display this box</message>
You can write your own cshtml to override the built-in page renderer in Turnkey.
You can write your own cshtml to override the built-in page renderer in Turnkey.



Latest revision as of 08:00, 17 June 2024

You can write your own cshtml to override the built-in page renderer in Turnkey.

Accessing the Angular $scope in Javascipt Code Called Inside a Page

If used in an element, this code gets the current scope.

angular.element(this).scope()

This will get the scope of the current element from "anywhere"

angular.element($0).scope()
An Example with Delayed Calling of Functions

For example, using this in an on-click event (NOT ng-click) will call the function DelayedSave in the script tag of the overridden page.

Note that a button can have both an ng-click and an on-click defined and both will be called.

onclick="DelayedSave(angular.element(this).scope())"

This example calls an action in the ViewModel called LazySave to save changes 2 seconds after the action with the on-click is executed.

<script>
  function DelayedSave(scope) {
  setTimeout(function () {
      scope.StreamingViewModelClient.CallServerAction('JournalSeeker', 'LazySave');
    }, 2000);
  };
</script>

Read more on how to make on-click work on an angular page: Ng-click ( ngClick ) not working

See also EXT Components for overriding only a ViewModel attribute with your own code.

This page was edited 12 days ago on 06/17/2024. What links here