how to use ckeditor in an angular js web App? - javascript

I am struggling to use ckeditor within my html page built in angularjs.
I have tried so many examples.
ng-ckeditor directive
ckeditor directive
But none of those examples helped me.
I want a textarea where I can input images within it and edit its contents style (Like in ckeditor).
Anyone please give me a clear example or demo fiddle on how to use ckeditor in angularjs.
I have also tried custom directive. It's not working.
Is there any alternative for ck editor?
Thanks in advance.

https://github.com/lemonde/angular-ckeditor. Step 1-3 are actually documented quite well in the README.md and the rest is pretty easy to develop...
get the angular-ckeditor: git clone -depth=50
https://github.com/lemonde/angular-ckeditor
download resoureces via
bower: bower install angular-ckeditor
Write yourself a controller
(see example in the README.md)
link your js files in your html, keep
track of the order:
use your controller and the directive inside your html as described. If you would like to pre-initialize your editor with data from your html, you could use something like this:
data-ng-init="content='this is a text with <a href="http://localhost/whatever.html" target="_blank">an embedded Link</a>'" contenteditable="true" ready="onReady()">
or you init your model variable(s) in your controller (hardcoded or via $http).
I have got this from How to use ckeditor in angular JS app?. and its worked for me.

Related

Use Angular4 functions like (click) [src] inside [innerHTML] of Angular4

I'm using markdown-it compiler to convert markdown text in html which I'm displaying using innerHTML.but problem is that I want to add function to some particular div and use [src] to display sanitized url of youtube in iframe.
it showing me error that sanitizer has stripped some part of code and no javascript functionality is working inside [innerHTML].
I heard that $compiler was the solution in angularJS. is it still available for ANgular4 and yes than can anyone help me to implement it?
Can any one help me to solve this problem?

Angular: how can I use JavaScript referenced in index.html in a component template?

Angular newbie here.
I have a color picker (jscolor) which works perfectly in my index.html, but I can't seem to use it the same way via my component template.
I have a script tag reference to it in the head of index.html. If I use the tag in index.html, it works perfectly. However, if I use in a component template, it doesn't work at all. I thought after transpilation, the template code would read as part of index.html.
How can I use the jscolor associated html tag in my component template?
JSColor documentation here
You need to properly inject the library to the code and execute it once your application is loaded.
Not sure which angular version you are using, but those threads might help you:
AngularJS JSColor pick up color to trigger AngularJS ng-change
Angular
Importing jscolor library in angular 2

How to create customize Html Editor in Extjs

I have requirement to create Customize Ext JS HTML Editor. I am facing problem in creating it.
Since you're not providing any information at all there are several solutions:
You can use CSS to style your HTML editor
You can use another editor, like TinyMCE to add extra functionality
You can have a look at the documentation on how to alter functionality of the current editor any maybe even create a subclass of it.
Hope this helps a bit.

How to build a widget to embed in third-party websites using AngularJs?

I would like to create a angularjs widget that can be embedded in third-party websites with minimal code such as
<script src=mywidget.js type=...></script>
<div id="mywidgetContainer"></div>
or similar.
I found some resources such as this article for developing a widget using jquery http://alexmarandon.com/articles/web_widget_jquery/.
How would it be done using Angularjs? In what clever ways can angular features such as directives/views etc. be harnessed to this purpose? What are the gotcha's if any? Your thoughts/suggestions/opinions/experiences, please.
You should also keep in mind the possibility that the 3rd party website also uses angular,
and potentially a different version.
Check Multiple versions of AngularJS in one page
This is what seems to have worked for me. In the script I set the innerHTML property of the Container div to the angular view markup code. The key point is to use angular.$bootstrap to manually bootstrap the app after the page load. I did not see any particular value in creating a directive. A directive would need to be part of the view code that would still need to be assigned to the container using innerHTML.

Adding JavaScript Code to A Single Page in Joomla (Google Remarketing Code)

I would like to add the Google Remarketing JavaScript code to my site. According to Google's documentation, I need to add the code right before the tag in my HTML document. I can easily do this in the template which would add the code to all of my pages. But what if I only want to add the JavaScript code to a single page? What is the best method to go about doing this?
I tried assigning a new module position right before the tag and inserting the code using a custom HTML module. Only problem is, it wrapped the code in a meaning the remarketing code wasn't truly inserted right above the tag.
You could use a module which allows to run custom code in it. There are several solutions to this in the JED: http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-modules
You could go about this by using JFactory::addScriptDeclaration();. More info can be found about this via the following link:
http://docs.joomla.org/JDocument/addScriptDeclaration
Or, you could try using Google Tag Manager which is a Plugin for Joomla 2.5 and 3.x

Categories

Resources