javascript - 将外部 javascript 包含到 Angular 中
问题描述
我试图将外部 javascript 和 html 包含到我的 Angular 应用程序中。
这是在 jsfiddle 中工作的作者教程
<!-- header source -->
<script src="https://www.givengine.org/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="https://www.givengine.org/components/chart-controller/chart-controller.html">
<!-- embed the browser in the web page -->
<chart-controller
title-text="A 2-minute starter of building a genome browser with GIVE"
ref="hg19"
num-of-subs="2"
coordinate='["chr18:19140000-19450000", "chr18:19140000-19450000"]'
group-id-list='["genes", "CHi-C_promoter"]'
></chart-controller>
所以我根据我的角度应用程序做了它,将脚本引用添加到 index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>EpiMiner</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="http://localhost:40080/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="http://localhost:40080/components/chart-controller/chart-controller.html">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
app.component.html
<chart-controller
title-text="A 2-minute starter of building a genome browser with GIVE"
ref="hg19"
num-of-subs="2"
coordinate='["chr18:19140000-19450000", "chr18:19140000-19450000"]'
group-id-list='["genes", "CHi-C_promoter"]'
></chart-controller>
但我得到一个“图表控制器不是已知元素”错误。没有太多的角度经验。建议表示赞赏。谢谢
解决方案
推荐阅读
- javascript - 动态“终端”样式文本框
- java - 活动将错误从 LoginActivity 重定向到 RegisterActivity
- javascript - 打开 Modal 并将 URL 发送到 iFrame
- apache-spark - 从 EMR 中的 Spark 默认类路径中删除 JAR
- java - Android DynamoDBMappingException:值中的预期 S
- spring-boot - 我的风暴螺栓无法在集群模式下反序列化
- javascript - Pointing to deeply nested objects parsed by a body parser(express)
- spring-boot - Spring Application 未因超时异常而终止
- python - 安装问题“pip install cx_Oracle-7.1.3-cp37-cp37m-win_amd64”
- r - 如何重命名重复名称的第一个(或 n 个)名称?