by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 29 12:05
    sbschorer commented #359
  • May 11 14:40
    mohammad-indpro opened #369
  • Dec 11 2019 21:47
    acclaimuser commented #214
  • Sep 27 2019 08:06
    vgavrilovikj opened #368
  • Aug 23 2019 18:21
    andypoorman closed #245
  • Apr 15 2019 14:31
    joshuarussell76 closed #367
  • Apr 15 2019 14:31
    joshuarussell76 opened #367
  • Mar 29 2019 07:27
    glapsable commented #345
  • Feb 24 2019 01:35
    jordanade commented #197
  • Feb 24 2019 01:03
    jordanade commented #197
  • Feb 08 2019 12:11
    webrider commented #82
  • Nov 22 2018 10:21
    sumeetmobiwebtech commented #363
  • Nov 22 2018 09:51
    madhurakhal commented #363
  • Oct 31 2018 11:24
    madflow closed #364
  • Oct 25 2018 20:10
    naXa777 commented #145
  • Sep 23 2018 14:44
    mostafabarmshory opened #366
  • Sep 23 2018 14:43
    mostafabarmshory commented #362
  • Sep 12 2018 15:02
    ombaocu commented #335
  • Aug 27 2018 23:36
    dassiorleando commented #365
  • Aug 26 2018 18:41
    deeg closed #365
Sunil Hirole
@sunil-ideas2it
Actually what i want is tp put some html content like button, images, heading tags in editor and want it to save it in db as it is . So that i can render that html and show it with the help of ng-bind-html inside some div

I am inserting this content for a button

<button type="button">Click Me!</button>

xxxxxx

After clicking saving this content i am getting a raw data which is getting saved in db

<p><span class="highLT">&lt;</span><span class="highELE">button</span> <span class="highATT">type=</span><span class="highVAL">"button"</span><span class="highGT">&gt;</span>Click Me!<span class="highLT">&lt;</span><span class="highELE">/button</span><span class="highGT">&gt;</span></p>
<p><strong><span class="highGT"> xxxxxx</span></strong></p>

Instead of this what i want is plain html content

Dan
@deeg
Did you see the example? That is putting HTML into the editor and displaying it on the page
Take a look at the example now
I added an image and a button
If you see in demo.js ctrl.tinymce is just a string of HTML
to get it to show with ng-bind-html you need to run it through $sce.trustAsHtml()
or you could use the inline version of tinymce editor for display mode
Sunil Hirole
@sunil-ideas2it

@deeg very true this thing i know but the trouble is i am inserting html tag as a plain text in editor and in db it is getting saved as

<p><span class="highLT">&lt;</span><span class="highELE">button</span> <span class="highATT">type=</span><span class="highVAL">"button"</span><span class="highGT">&gt;</span>Click Me!<span class="highLT">&lt;</span><span class="highELE">/button</span><span class="highGT">&gt;</span></p>
<p><strong><span class="highGT"> xxxxxx</span></strong></p>

If i can get the string contains html then i can use $sce.trustAsHtml() and displayed it in div

I am typing html content into editor not inserting via angular

Sunil Hirole
@sunil-ideas2it

@deeg i want to bind this content

<button type="button">Click Me!</button>

<img src="http://www.tutorialspoint.com/images/html.gif" alt="HTML Tutorial" height="150" width="140" />

can u pls type it in your tinyMCE editor and look into it so that it can be bind

Dan
@deeg
This is not an issue with the ui-tinymce library
You are looking for core tinymce features
If you go to their full featured example (https://www.tinymce.com/docs/demo/full-featured/) you can see that you can edit the source code to add images through tools -> source code
You would have to go about adding the tags you want to their whitelist
That is the best way I know though
tinymce is a text wysisyg editor. Not meant to take in HTML and display HTML. They have plugins which allow you to add images by provding links and such. My guess is you want to take advantage of those features instead of directly pasting in HTML into the editor
At their plugin page (https://www.tinymce.com/docs/plugins/) you can also see plugins people have written to help with these things like PowerPaste
Ganesh Rao
@ganeshnrao
Hey, is there a simple way to toggle the TinyMCE mode from within Angular on a specific element that has the ui-tinymce set to a scope object?
Dan
@deeg
@ganeshnrao, do you mean like inline mode vs non inline mode?
Ganesh Rao
@ganeshnrao
no, I mean like if I was able to toggle the contenteditable state of the a div.
Dan
@deeg
so you want to toggle the enabled/disabled state?
Ganesh Rao
@ganeshnrao
yeah
Dan
@deeg
Alright one second, I’ll send you an example
Ganesh Rao
@ganeshnrao
awesome! Thanks
Dan
@deeg
How are you disabling. Through ng-disabled?
Dan
@deeg
Try taking a look at this example
depending on how your directives are set up you might be able to use $emit instead of $broadcast
This changes the readonly setting and then fires the refresh event.
Ganesh Rao
@ganeshnrao
Hmm, that works. Is there a simpler way to do this without having to call $emit or $broadcast? I basically have a page that has over 50 different tinyMCE objects, and $emit takes a while to update the page. https://plnkr.co/edit/jdtVjW94e0xdc9PnIRaL?p=preview
Ganesh Rao
@ganeshnrao
I figured it out! https://plnkr.co/edit/jdtVjW94e0xdc9PnIRaL I push the Editor instance upon setup into an array within the scope. Then, when the "edit" button is clicked, I call the setMode method on all Editor instances stored in the array. This makes the code a bit more easier to read and it avoids having to emit/broadcast the TinyMCE. One minor issue however is that when updating the mode of all Editor instances, it calls $apply too many times causing Angular to throw the $apply already in progress error.
Dan
@deeg
@ganeshnrao feel free to post a bug on the repo and I can take a look into fixing it.
Shyamal Parikh
@shyamal890
Hey @deeg will ng-model-options work with ui-tinymce enabled on textarea?
Dan
@deeg
I don’t believe right now they will. Feel free to open an issue if it isn’t working and we can look into implementing it. Feel free to put out a PR!
Lucas Granberg
@lucasgranberg
I use tinymce with a yeoman project and as you might imagine the inclusion of themes and plugins doesn't go all to well with that. I solved it by using a cdn for all the resources. Like this
```js
{
...
external_plugins: {
link: 'https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.3.12/plugins/link/plugin.min.js',
paste: 'https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.3.12/plugins/paste/plugin.min.js'
},
theme_url: 'https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.3.12/themes/modern/theme.min.js',
skin_url: 'https://cdnjs.cloudflare.com/ajax/libs/tinymce/4.3.12/skins/lightgray',
...
}
Is there a better way?
Its kind of tricky as I don't want to copy all the plugins to the dist folder of my app. I could add them manually to my gruntfile so they are copied over and not concated but its kind of ackward. It kind of works like this but its not pretty
Dan
@deeg
@lucasgranberg what we do at my work is use grunt to copy over the files we need and relativley point to those in the skin_url
Lucas Granberg
@lucasgranberg
ok thanks
Shyamal Parikh
@shyamal890
@deeg Is there any hack as of now to use ng-model-options anyway? I just want a digest to occur on blur
Dan
@deeg
@shyamal890, sorry was on vacation. Let me take a look this afternoon and get back to you.
Shyamal Parikh
@shyamal890
@deeg I manually updated the js file for my temporary use. Please do let me know what you think of the changes angular-ui/ui-tinymce#252
Ren Hao
@renkaixin
@deeg I publish '$tinymce:refresh' event to rebuild editor when I sort a list of editors in angular. But I found everytime directive received the event without unbind it which generated a lot of listeners in scope. This is my angular-ui/ui-tinymce#272 (Maybe there's something wrong in test code. Why I pull request with simple change and causes building failed)
Igor Filippov
@IgorFilippov3
Hello guys, I am new for tinymce. Can somebody tell me, how can i load my html template in editor? Only throw tinymceModel or u know some other methods? Cuz it is a little bit strange to send my template like string in ng-model. Sorry for English, btw. Maybe somebody have good examples about my problem? Google didnt help me ((
Alex
@atodicebear
Hey :)
Is there an Example for UI-TinyMce/TinyMce with Angular 1.5.x & ECMAScript6 for Saving Content to Database through ng-repeat generated TinyMce Editors(it means there are more than one)?
The https://www.tinymce.com/docs/plugins/save/ is not really helpfull :/
Alex
@atodicebear
Alex
@atodicebear
Someone got the Problem If you have TinyMces in a Table with Pagination and there are more than 1 Page Sorting is working. But as soon there is only one Page that Sorting breaks the Editors? Content is removed and the Textarea is not Clickable anymore?
ramadhani
@cyber41

This is the expected markup which is created dynamically

<textarea data-ng-model="cv.experience[content.title]"></textarea>
<textarea data-ng-model="cv.experience[content.title]"></textarea>

This is the sample of the JSON I want to achieve

experience:{

    content:[
        {
            header:String,
            title:String,
            start_date:Date,
            end_date:Date,
            location:String,
            description:String
        },
        {
            header:String,
            title:String,
            start_date:Date,
            end_date:Date,
            location:String,
            description:String
        },
        ....
    ]
}

How can i archive above structure using ** ng-model **

princewck
@princewck
anybody?