Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In this code for each of the inframe's that are placed in the HTML, another html containing the ckeditor is called.

ASP.NET
<body ng-app="myApp">
    <form method="post" ng-controller="TinyMceController">
        <iframe id="iframe1" name="iframe1" runat="server" src="demo.html" style="width: 840px; height: 233px" ></iframe>
        <iframe id="iframe2" name="iframe2" runat="server" src="demo.html" style="width: 840px; height: 233px" ></iframe>
        <iframe id="iframe3" name="iframe3" runat="server" src="demo.html" style="width: 840px; height: 233px" ></iframe>
        <iframe id="iframe4" name="iframe4" runat="server" src="demo.html" style="width: 840px; height: 233px" ></iframe>
        <br>        
        <!--<label>Editor a obtener: <input type="text"  runat="server" ng-model="name"></label>-->
        <button ng-click="getContentControl()">Obtener contenido de: "{{name}}"</button>
        <br>
    </form>
</body>

This is the code of the ckeditor (demo.html)
<body ng-app="myApp">
    <form method="post" ng-controller="TinyMceController">
        <div> 
            <textarea name="editor1" id="editor1"  ng-model="tinymceModel"></textarea>
        </div>
        <script>
             CKEDITOR.replace('editor1');
        </script>
        <button ng-click="getContent()">Get content</button>        
    </form>
</body>

this is the angular code I'm trying
$scope.getContentControl = function () {
    var iFrame = angular.element('#iframe2' + name);
    console.log(iFrame);
    var Element = iFrame.getElementById('editor1');
    console.log(Element);

};

what I want to know how to do in angular, how do I get the html (.getData()) of one or each of the ckeditor that are inside each of the iframes?

What I have tried:

what I want to know how to do in angular, how do I get the html (.getData()) of one or each of the ckeditor that are inside each of the iframes?
Posted
Updated 17-Nov-17 1:08am

I solved your demo page contain page like the demo page
<html>
<head id="Head1" runat="server">
    <title></title>
   
    
        
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>


<script>
    var myApp = angular.module('myApp', []);
    myApp.controller('TinyMceController', function ($scope, $http)
     {
        
        $scope.getContent = function () {
            $scope.tinymceModeldata = $scope.tinymceModel;
           
        };

    });

  

</script>
</head>
<body>
    <div ng-app="myApp" ng-controller="TinyMceController" ng-init="tinymceModeldata='some data';">
    <div>
        <div> 
            <textarea name="editor1" id="editor1"  ng-model="tinymceModel"></textarea>
        </div>
        <!--<script>
            CKEDITOR.replace('editor1');
        </script>-->
        <p>{{tinymceModeldata}} </p>
        <input type="button" id="btnshow" value="getcontaint" ng-click="getContent()" />   
    </div>

</div>
</body>
</html>
 
Share this answer
 
//I send the two pages that works well


//Demo



<title>








var myApp = angular.module('myApp', ['ngCookies']);

myApp.controller('TinyMceController', ['$scope', '$http', '$cookies', '$cookieStore', function ($scope, $http, $cookies, $cookieStore)
{

$scope.getContent = function () {


$cookies.Containts1 = $scope.tinymceModel;

$scope.tinymceModeldata = $scope.tinymceModel;

};

}]);












{{tinymceModeldata}}










//containing page




<title>










var myApp = angular.module('myApp', ['ngCookies']);
myApp.controller('TinyMceController', ['$scope', '$http', '$cookies', '$cookieStore', function ($scope, $http, $cookies, $cookieStore)
{
$scope.getContentControl = function () {
$scope.name = $cookies.Containts1;

};

}]);

















Obtener contenido de: {{name}}








 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900