-1

sorry for my english. how to add js code in ionic 3 for use in particular page. im create countdown timer like this but ts (typescript) not accept js code. Thanks. like thisenter image description here

2
  • TypeScript is a superset of Javascript, it does accept Javascript code. Can you show us code you're trying to add? Commented Jun 22, 2018 at 13:24
  • thanks zooty: i'm using that js code : codepen.io/arcarr/pen/vGVGXN Commented Jun 22, 2018 at 13:47

1 Answer 1

0

Adding a custom JS in ionic is usually not needed.

But if you want to use use it anyway, You can refer to the StackOverflow Answer on using the custom JS to the ionic project.

Sign up to request clarification or add additional context in comments.

5 Comments

im attempting these step nothing happens just pop window generate and say hello from external js.
var testvar = "Hello from external js" in js file
add js reference in index.html <script src="assets/js/test.js"></script>
declare var testvar; in component.ts
alert(testvar); in component.ts under the constructor {}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.