Copied to clipboard

Flag this post as spam?

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


  • Thomas Beckert 193 posts 469 karma points
    Aug 05, 2016 @ 10:35
    Thomas Beckert
    0

    Change releaseDate by Javascript / Angular

    Hi,

    I want to set the releaseDate from a different inputfield.

    My thought was, in the Save-Event, I just set the $scope.content.releaseDate to the Date I entered in my inputfield. But the new value is ignored by my Save function:

     function performSave(args) {
            var deferred = $q.defer();
             $scope.page.buttonGroupState = "busy";
             $scope.content.releaseDate = "2016-09-04 12:53:14"; // Hardcoded for testing
    
            contentEditingHelper.contentEditorPerformSave({
                statusMessage: args.statusMessage,
                saveMethod: args.saveMethod,
                scope: $scope,
                content: $scope.content,
                action: args.action
            }).then(function (data) {
                //success            
                init($scope.content);
                syncTreeNode($scope.content, data.path);
    
                $scope.page.buttonGroupState = "success";
    
                $(".customButtons button").removeClass("loadingButton");
    
                deferred.resolve(data);
            }, function (err) {
                //error
                if (err) {
                    editorState.set($scope.content);
                }
    
                $scope.page.buttonGroupState = "error";
    
                deferred.reject(err);
            });
    
            return deferred.promise;
        }
    

    Any idea what's wrong?

Please Sign in or register to post replies

Write your reply to:

Draft