Copied to clipboard

Flag this post as spam?

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


  • Ross Ekberg 124 posts 365 karma points
    Sep 13, 2023 @ 18:02
    Ross Ekberg
    0

    Update Backoffice Angular Controller

    Umbraco 10

    I have several custom backoffice sections. The files for these sections are located in the App_Plugins folder in the project. Each section, in their own folders, consists of a dashboard.html, controller.js, and a package.manifest. On the dashboard is an iframe that is displaying an in-house user control. The URL to the iframe is being set from within the controller because details about the user need to be passed to the user control so the url needs to be adjusted before being plugged in.

    This site is currently in development, so the urls are temporary. Everything is working fine, so now I need to update the urls to the live versions. However, for some reason, when I change the urls in the controller, it isn't reflecting in the backoffice. I don't now how to get it to change. I have tried doing a hard refresh, deleting the cache, deleting the file and re-adding it. Nothing works. Does anyone have any ideas what could be going on here?

    Again, everything works correctly with the OLD LINE (see below). I change it to the NEW LINE (see below) and publish the site. I look at the published code and I can see that the NEW LINE is there. However, when I log into the backoffice and goto the section, I inspect the element and see the url of the iframe it's still the OLD LINE.

    HTML:

    <div ng-controller="SubscriptionsController">
        <iframe id="ifrWebSubscriptions" ng-src="{{url}}" title="Web Subscriptions" frameborder="0" style="width:100%;background:none;" onload="this.height=screen.height;"></iframe>
    </div>
    

    Controller:

    angular.module('umbraco').controller('SubscriptionsController', function ($scope, $sce, userService) {
        var user = userService.getCurrentUser().then(function (user) {
            var email = user.email;
            var enc = window.btoa(email);
    OLD LINE:  $scope.url = $sce.trustAsResourceUrl("https://testuc.domain.com/websubscriptionsadmin/viewadmin.aspx?t=" + enc);
    NEW LINE:  $scope.url = $sce.trustAsResourceUrl("https://uc.domain.com/websubscriptionsadmin/viewadmin.aspx?t=" + enc);
        });
    
    });
    
  • katip69 3 posts 53 karma points
    Sep 15, 2023 @ 12:10
    katip69
    100

    i had the same problem, sometimes updates if you delete the smidge folder of the project

  • Ross Ekberg 124 posts 365 karma points
    Sep 15, 2023 @ 13:19
    Ross Ekberg
    0

    Smidge folder?

  • Ross Ekberg 124 posts 365 karma points
    Sep 15, 2023 @ 18:20
    Ross Ekberg
    0

    Well I'll be a monkey's uncle. That was it. I didn't eve know about a "smidge" folder.

    I deleted the content of the folder and then rebuilt/republished the project. That took care of the issue.

Please Sign in or register to post replies

Write your reply to:

Draft