Ionic - Adding js links in script tags

Hi, how do I add the scripts below to my ionic 2 project?

[script src=“” script][/script]
[script src=“”][/script]

pretend the brackets are greater than less than.

Maybe this can help you.

Haven’t tried it myself, had problems with even getting typings to work then I started learning about Ionic. :sweat_smile:

Im sorry no. I still have issues. The documentation on using script tags is unclear and every third party review on the matter never specifies implementation or a work around.

Its very tough.

If i cant use this with braintree I cant use this at all.

I mean, I know that script tags go in the src/index.html but the hello-ionic.html page that uses the src file cant access it.

same problem here. Have you solved it?

You can put the script tags in the index.html that sits in www. place it after
build/main.js script tags

you can also take the code inside the script tags and place in a ts file.

the variables will have to be declared as -> variable: (type);

types include any, String, Number, etc. Use “any” if ur not sure which type it ought to be.

assign the variable a value -> variable = (value, function, class, etc.);

And each time u call the variable u use an instance -> this.variable;

In regards to using braintree, you have to create the braintree backend (using the implementation of your choice) which you will then upload to a server.

You will then create an api call to access braintree from your client app.


If you are just looking to include a simple JavaScript library (something like a google maps api for rendering maps) you can add the script tag to the index.html that sits in the \src directory of your project.