Can you import dependencies from your other plunks?

一曲冷凌霜 提交于 2019-12-07 09:19:25
Geoff Goodman

You absolutely can refer from one plunk to another, but the mechanics to do so are not very well exposed. Historically, Plunker didn't expose this to users by design.

In future versions, Plunks will be publishable as semver versioned packages to the package manager and this sort of thing will automatically be wired up for you.

To use the type of setup you propose in Plunker today, you can:

  1. Create your new directive as its own Plunk and make sure that it is saved. It doesn't matter if it is public or private.
  2. Note this new plunk's id as its latest saved version will be available at http://run.plnkr.co/plunks/<plunkId>/[filename.ext]
  3. In your 2nd plunk, you can either:
    • Add the directive to the package catalogue using the above url and then add that new package to your plunk; or
    • Add the directive script directly to your index.html via a typical <script src="<url>"></script> tag.

I think that better search capabilities (already in preview at http://explore.plunker.co) and this mechanism for publishing versioned plunks to the catalogue will allow some really cool and efficient workflows for the next generation of online prototyping.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!