Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70750

How do I add Loading-bar external JS file into my ionic project

$
0
0

@lifesuxtr wrote:

Hello I am trying to import this library into my ionic project.

What I did is I copied loading-bar.js and CSSinto my assets folder.Then I added those 2 lines to index.html:

  <link rel="stylesheet" type="text/css" href="assets/loading-bar.css">
  <script type="text/javascript" src="assets/loading-bar.js"></script>

I added this line to ts file of the page that i want to use the library

import * as loading from '../assets/loading-bar';

I added this to html file of page:

  <div id="myItem1"></div>

Then with this code I tried it:

var bar1 = new ldBar("#myItem1");
  var bar2 = document.getElementById('myItem1').ldBar;
  bar1.set(60);

This is the error:
error

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>