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

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?

Related

Angular interpolation,directive,ngModel does not work

Currently i'm trying to customize Ngx-Editor to add feature like Table in the editor.
the editor is base on textarea and i create table using document.createElement() and insert into textarea using document.execCommand('insertHTML').
but the problem is i want a popover on the table if click and right-click feature so that a popup can be raise to edit the existing table.
but using any interpolation or directive in table does not work.
like {{somecontent}} is printed as it is.
so is there any way to create Table with popover and context-menu outside angular context.
i'm using Angular 4.
It doesn't work because you're adding code to your application post-build.
Ask yourslef : is {{ someContent }} valid vanillaJS code ? If you write this in a Javascript file, will it work ?
No. Because this is an Angular syntax, and it's read by the compiler to be translated into vanillaJS.
Furthermore, you should not manipulate the DOM yourself when using Angular. The framework is supposed to handle that for you.
If you want a custom component, you have to create one from scratch (or fork an existing one). You can't extend a component on the fly.

how to use ckeditor in an angular js web App?

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.

JSF custom component missing auto generated JavaScript when used with Oracle ADF

am working on project, where custom JSF component is built and it is working fine in test *.jsp page.
But when this custom tag is used within ADF tag, it's not working. (in weblogic server)
<af:showDetailItem ......>
<af:panelGroupLayout ......>
<custom:customComp .... />
</af:panelGroupLayout.>
</af:showDetailItem>
Error Details: Custom tag is rendered properly. When ever I click on any button inside a custom component it won't work. I analyzed rendered output of jsp/adf page using firebug. I found auto generated JavaScript for custom components are missing.
Could anybody please point me out why the JavaScript for (only) custom tag is not loaded.
Check this reference this reference, I believe it should fix your problem

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

How to use the function given in the link + javascript

I am a newbie to javascript functioning and wanted to see its functioning regarding pasting dynamic data in the html.
I have this link where they tell what to use for the same in a table but I can't figure out how to do the same...
The link to the code is javascript link
I first made an html page using the html shown and then added the lines of javascript shown below it in <SCRIPT LANGUAGE="JavaScript"> tag.
But I am not getting the same output.... What am i doing wrong ?
Please help...
It seems like the example you're trying to imitate is doing client-side data binding. First of all, yes, you need to reference jQuery script in your page. Secondly, you'd be better off accomplishing client-side data binding with the jQuery Templates plugin.

Categories

Resources