Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonathan Roberts 372 posts 1004 karma points
    Aug 09, 2017 @ 09:25
    Jonathan Roberts
    0

    Extend the performSave function in AngularJs

    Hi,

    I have created a macro using AngularJS and have my own Controller.

    I would like to somehow extend the $scope.saveAndPublish function from umbraco.controller.js file so when a user publishes a page my code runs too.

    Is this possible? I dont really want to hack into the umbraco.controller.js code as the next time there is an Umbraco update this code will need to be readded.

    Thanks Jon

  • David Brendel 774 posts 2843 karma points c-trib
    Aug 09, 2017 @ 09:29
    David Brendel
    0

    Hi Jonathan,

    not sure if that is really a good idea. Think something like that can be done with interceptors. But not tried it myself so not really an example at hand.

    Regards David

  • Jonathan Roberts 372 posts 1004 karma points
    Aug 09, 2017 @ 09:48
    Jonathan Roberts
    0

    Cool - I have looked into Interceptors and it looks good - just wondering if it is possible to get the Controller scope in the Interceptor?

  • David Brendel 774 posts 2843 karma points c-trib
    Aug 09, 2017 @ 10:47
    David Brendel
    0

    Hi Jonathan,

    not sure as I haven't done it myself. :) Maybe someone else has an idea.

    Regards David

Please Sign in or register to post replies

Write your reply to:

Draft