grunt-ngdocs:演示文件中未包含样式文件 [英] grunt-ngdocs: styles file not included to demo code

查看:95
本文介绍了grunt-ngdocs:演示文件中未包含样式文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 grunt-ngdocs 来记录我的Angular项目.但是演示的Plunker代码(自动生成)不包含CSS文件.

I am using grunt-ngdocs to document my Angular project. But the demo Plunker code (generated automatically) doesn't include the CSS file.

我在Gruntfile.js中的配置包括:

...
scripts: [
    'https://code.jquery.com/jquery-2.1.4.js'
],
styles: [
    'https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.0.7/semantic.css'
]
...

在我的JS src文件中:

In my JS src file:

@example
    <example module="sui.checkbox">
        <file name="index.html">
        ...
        </file>
    <example>

在"API"页面上,已正确加载JS和CSS文件.但是,显示的demo源代码不包含CSS文件:

On the API page, the JS and CSS files are loaded correctly. However the displayed demo source code doesn't include the CSS file:

<!doctype html>
<html ng-app="sui.checkbox">
  <head>
    <script src="https://code.jquery.com/jquery-2.1.4.js"></script>
    <script src="app.js"></script>
    <!-- semantic.css should be imported here -->
  </head>
  <body>
    ...
  </body>
</html>

在我的API页面上,演示效果很好.但是链接到Plunker不会产生期望的结果,因为CSS包含行不存在.有什么建议吗?

On my API page, the demo works well. But linking to Plunker doesn't produce desired result, because the CSS including line is not there. Any suggestions?

推荐答案

使用临时解决方案.在javascript文件的@example部分的内部中添加以下行:

Use a temp solution. Add the following line inside the javascript files @example section:

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.0.7/semantic.css">

这篇关于grunt-ngdocs:演示文件中未包含样式文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆