This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11425|Reply: 0

[Angular] Angular 9 series (VI) calls native JS variables and methods

[Copy link]
Posted on 6/10/2020 10:33:24 AM | | | |
review

Angular 9 Series (1) Dynamically Loaded Components
https://www.itsvse.com/thread-9238-1-1.html

Angular 9 series (2) dynamic component transmission parameters
https://www.itsvse.com/thread-9245-1-1.html

Angular 9 series (3) subscribes to dynamic component events
https://www.itsvse.com/thread-9246-1-1.html

Angular 9 Series (IV) Custom Pipe pipelines
https://www.itsvse.com/thread-9248-1-1.html

Angular 9 Series (V) formats the amount currency format
https://www.itsvse.com/thread-9249-1-1.html


When developing an angular single page, we may embed the page into the existing web page, and the existing web page will introduce a lot of original js and css files, and we may need to use the original web page packaging methods or variables.

What about using angular to call native JS variables and methods? This article will introduce it in detail.

In fact, we have already used it before.

Angular6 introduces Baidu map tutorial
https://www.itsvse.com/thread-7481-1-1.html

First, we define several js variables and methods from index.html, the code is as follows:


We put a button button in the Angular component, click the "execute js" button, and it will execute the method we have defined and get the defined variables.

The renderings are as follows:



ts file code:


(End)





Previous:TS Missing radix parameter (radix)
Next:Budget 10 kB was not met by 20 kB with a total of 30 kB
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com