Copied to clipboard

Flag this post as spam?

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


  • Mathias 51 posts 205 karma points
    Mar 29, 2019 @ 09:47
    Mathias
    0

    V8: Unable to open a simple dialog

    I'm trying to open a simple dialog using the "editorService" injected into my angular controller.

    $scope.openContentDialog = function () {
            editorService.open({
                template: "/app_plugins/rexelgrid/content/dialog.html",
                show: true
            });
    }
    

    dialog.html

    <div ng-controller="rexel.grid.contentdialogcontroller">
        <h1>Hello, world</h1>
    </div>
    

    This is as basic of an example if I ever saw one, but yet, it doesn't work. When I attempt to open the dialog I can a blank sheet opening up instead and the following error is printed to the browser console:

    Error: "[ngTransclude:orphan] Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: <div ng-if="!model.view &amp;&amp; !model.animating" ng-transclude="" class="ng-scope">
    https://errors.angularjs.org/1.7.5/ngTransclude/orphan?p0=%3Cdiv%20ng-if%3D%22!model.view%20%26amp%3B%26amp%3B%20!model.animating%22%20ng-transclude%3D%22%22%20class%3D%22ng-scope%22%3E"
        Angular 12
        revealEditorContent http://localhost:54420/umbraco/js/umbraco.directives.js?cdv=136124549:5238
     <div ng-if="!model.view &amp;&amp; !model.animating" ng-transclude="" class="ng-scope">
    

    Yeserday, I found out that the dialogService from previous versions of Umbraco is now called editorService (doesn't say so on the official doc pages). So I'm wondering, have they disabled the ability to open custom dialogs, or am I using the wrong thing?

    Appreciate any help I could get.

    // M

  • seanrock 262 posts 483 karma points
    Mar 29, 2019 @ 13:35
    seanrock
    101

    try this. if you want a larger dialog, leave off the size param.

    var editorOptions = {
                title: 'Search',
                view: 'path_to_your_dialog.html',
                size: 'small'
            };
            editorService.open(editorOptions);
    
  • Gurumurthy 54 posts 127 karma points
    Sep 09, 2020 @ 10:43
    Gurumurthy
    0

    HI Mathias,

    Do this got fixed, i am also facing the same issue..

    Appreciate the help on this.

    Thanks,

    Gurumurthy J V

  • Mathias 51 posts 205 karma points
    Sep 09, 2020 @ 11:42
    Mathias
    1

    Gurumurthy, try what Seanrock suggested above.
    This was so long ago that I don't remember how I got it to work

  • Gurumurthy 54 posts 127 karma points
    Sep 09, 2020 @ 12:08
    Gurumurthy
    0

    Yes, i tried that, now the dialog opens, but again still some more error on angular.copy()

    $scope.settings = angular.copy($scope.dialogOptions.controlValue) || $scope.defaultSettings;
    

    $scope.dialogOptions. is undefined, is this changed in v8 ?

    Getting below console error TypeError: Cannot read property 'controlValue' of undefined

  • Mathias 51 posts 205 karma points
    Sep 09, 2020 @ 12:21
    Mathias
    0

    you need to provide more of your code in order for me to try and help you

  • Gurumurthy 54 posts 127 karma points
    Sep 09, 2020 @ 13:10
    Gurumurthy
    0

    Let me brief here, i have upgraded from v7.15.2 to v8.6.4, and their are lot of custom app plugins written in older version, So as part of migration, this is not working.

    $scope.settings = angular.copy($scope.dialogOptions.controlValue) || $scope.defaultSettings;

    scope.dialogOptions coming as "undefined" in v8, but not in v7.. is this some ting changed in v8 ?

    the dialogOptions some thing not available in $scope of v8 object ?

    so, due to this, i am not able to view the custom properties in the dialog which is opened.

  • Mathias 51 posts 205 karma points
    Sep 10, 2020 @ 05:52
    Mathias
    0

    If im not mistaken, the $scope object is just a public object on which you can attach other objects. So if dialogOptions is undefined, that means that it hasn't been added to the $scope object yet.

    I am unfamiliar with what has changed from v7 to v8 in regards to $scope. So unfortunately I cannot help you.

    I suggest you log the entire $scope object in your controller to see what it contains

    Best of luck!

  • Yogeshwer Sharma 10 posts 80 karma points
    Aug 12, 2024 @ 17:55
    Yogeshwer Sharma
    0

    Does anyone able to resolve this I am getting same issue ?

Please Sign in or register to post replies

Write your reply to:

Draft