adding custom scripts with custom attributes in angular 6 projectHow to create angular 5 project in angular cli 6.0.1Could not find module “@angular-devkit/build-angular”Modify angular cli build to run custom scriptwhy default check attribute is not working in angular 6integrating bootstrap in angular X projectHow to read data attribute value in angular 6Custom directive is not working for angular 6:Add custom node Library Project to Angular ProjectAdd Custom Attribute to Request Header Angular 6Nested component calls in the angular project?
Should I hide continue button until tasks are completed?
Why is the voltage measurement of this circuit different when the switch is on?
How come I was asked by a CBP officer why I was in the US?
What kind of wire should I use to pigtail an outlet?
Could Sauron have read Tom Bombadil's mind if Tom had held the Palantir?
Do French speakers not use the subjunctive informally?
What do you call a weak person's act of taking on bigger opponents?
MH370 blackbox - is it still possible to retrieve data from it?
C-152 carb heat on before landing in hot weather?
Why is the Turkish president's surname spelt in Russian as Эрдоган, with г?
When is it ok to add filler to a story?
Why is C++ initial allocation so much larger than C's?
Peace Arch without exiting USA
Why do some professors with PhDs leave their professorships to teach high school?
When is the original BFGS algorithm still better than the Limited-Memory version?
STM Microcontroller burns every time
Change the boot order with no option in UEFI settings
Is adding a new player (or players) a DM decision, or a group decision?
Impossible darts scores
Distance Matrix (plugin) - QGIS
Employer wants to use my work email account after I quit, is this legal under German law? Is this a GDPR waiver?
Short and long term plans in a closed game in the Sicilian Defense
How to perform Login Authentication at the client-side?
Alphabet completion rate
adding custom scripts with custom attributes in angular 6 project
How to create angular 5 project in angular cli 6.0.1Could not find module “@angular-devkit/build-angular”Modify angular cli build to run custom scriptwhy default check attribute is not working in angular 6integrating bootstrap in angular X projectHow to read data attribute value in angular 6Custom directive is not working for angular 6:Add custom node Library Project to Angular ProjectAdd Custom Attribute to Request Header Angular 6Nested component calls in the angular project?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to add a script(cdn) in a component in my angular project.
on in it
// Start: for drop box
var dbx = new Dropbox( accessToken: 'A4fRBcFXasdkpAAAAAdgfdfgdfgAAAAAZBlQ9MJNe81yrTLOCioH-7Ty083asdEQSqTD97s7mLIJH0V', fetch: fetch );
dbx.filesListFolder( path: '' )
.then(function (response)
console.log(response);
)
.catch(function (error)
console.log(error);
);
// End: for dropbox```
addJsToElementDropbox(src: string, type: string, id: string, key: string): HTMLScriptElement
let script:any = document.createElement('script');
script.type = type;
script.src = src;
script.id = id;
this.renderer.appendChild(document.body, script);
return script;
```
This is the script created in the DOM
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs"></script>
My need is to create a script like this in DOM
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="my-key"></script>
angular6
add a comment |
I need to add a script(cdn) in a component in my angular project.
on in it
// Start: for drop box
var dbx = new Dropbox( accessToken: 'A4fRBcFXasdkpAAAAAdgfdfgdfgAAAAAZBlQ9MJNe81yrTLOCioH-7Ty083asdEQSqTD97s7mLIJH0V', fetch: fetch );
dbx.filesListFolder( path: '' )
.then(function (response)
console.log(response);
)
.catch(function (error)
console.log(error);
);
// End: for dropbox```
addJsToElementDropbox(src: string, type: string, id: string, key: string): HTMLScriptElement
let script:any = document.createElement('script');
script.type = type;
script.src = src;
script.id = id;
this.renderer.appendChild(document.body, script);
return script;
```
This is the script created in the DOM
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs"></script>
My need is to create a script like this in DOM
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="my-key"></script>
angular6
add a comment |
I need to add a script(cdn) in a component in my angular project.
on in it
// Start: for drop box
var dbx = new Dropbox( accessToken: 'A4fRBcFXasdkpAAAAAdgfdfgdfgAAAAAZBlQ9MJNe81yrTLOCioH-7Ty083asdEQSqTD97s7mLIJH0V', fetch: fetch );
dbx.filesListFolder( path: '' )
.then(function (response)
console.log(response);
)
.catch(function (error)
console.log(error);
);
// End: for dropbox```
addJsToElementDropbox(src: string, type: string, id: string, key: string): HTMLScriptElement
let script:any = document.createElement('script');
script.type = type;
script.src = src;
script.id = id;
this.renderer.appendChild(document.body, script);
return script;
```
This is the script created in the DOM
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs"></script>
My need is to create a script like this in DOM
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="my-key"></script>
angular6
I need to add a script(cdn) in a component in my angular project.
on in it
// Start: for drop box
var dbx = new Dropbox( accessToken: 'A4fRBcFXasdkpAAAAAdgfdfgdfgAAAAAZBlQ9MJNe81yrTLOCioH-7Ty083asdEQSqTD97s7mLIJH0V', fetch: fetch );
dbx.filesListFolder( path: '' )
.then(function (response)
console.log(response);
)
.catch(function (error)
console.log(error);
);
// End: for dropbox```
addJsToElementDropbox(src: string, type: string, id: string, key: string): HTMLScriptElement
let script:any = document.createElement('script');
script.type = type;
script.src = src;
script.id = id;
this.renderer.appendChild(document.body, script);
return script;
```
This is the script created in the DOM
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs"></script>
My need is to create a script like this in DOM
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="my-key"></script>
angular6
angular6
edited Mar 26 at 10:13
dpolicastro
4473 silver badges9 bronze badges
4473 silver badges9 bronze badges
asked Mar 25 at 10:26
Raru ChempazhanthyRaru Chempazhanthy
276 bronze badges
276 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Use set attribute set custom attribute
addJsToElement1(src: string, type: string): HTMLScriptElement
const script = document.createElement('script');
script.setAttribute('data-app-key', 'Test');
script.type = type;
script.src = src;
this.renderer.appendChild(document.body, script);
return script;
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55335707%2fadding-custom-scripts-with-custom-attributes-in-angular-6-project%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use set attribute set custom attribute
addJsToElement1(src: string, type: string): HTMLScriptElement
const script = document.createElement('script');
script.setAttribute('data-app-key', 'Test');
script.type = type;
script.src = src;
this.renderer.appendChild(document.body, script);
return script;
add a comment |
Use set attribute set custom attribute
addJsToElement1(src: string, type: string): HTMLScriptElement
const script = document.createElement('script');
script.setAttribute('data-app-key', 'Test');
script.type = type;
script.src = src;
this.renderer.appendChild(document.body, script);
return script;
add a comment |
Use set attribute set custom attribute
addJsToElement1(src: string, type: string): HTMLScriptElement
const script = document.createElement('script');
script.setAttribute('data-app-key', 'Test');
script.type = type;
script.src = src;
this.renderer.appendChild(document.body, script);
return script;
Use set attribute set custom attribute
addJsToElement1(src: string, type: string): HTMLScriptElement
const script = document.createElement('script');
script.setAttribute('data-app-key', 'Test');
script.type = type;
script.src = src;
this.renderer.appendChild(document.body, script);
return script;
answered Mar 25 at 12:34
VishnudasVishnudas
665 bronze badges
665 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55335707%2fadding-custom-scripts-with-custom-attributes-in-angular-6-project%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown