LoginSignup
4
3

More than 5 years have passed since last update.

playframeworkでPolymerを使ってみる(導入メモ)

Posted at

なんかWindowsでplayframework を run すると main が見つからないと怒られ、macだと問題なく動く・・・

Polymerとは

話題のMaterial Designを提供するフロントエンドフレームワークです。
https://www.polymer-project.org/

準備

playframework

activator new
でプロジェクトを作成。

polymer

基本的には
https://www.polymer-project.org/docs/start/getting-the-code.html
に従います。(bowerでやりました)
playframeworkで使用する場合にはpublic配下に全部ぶち込みましょう。

配置

スクリーンショット 2014-12-13 23.27.56.png

使用方法

main.scala.htmlに以下の通り記述します。

main.scala.html
<script src="@routes.Assets.at("bower_components/webcomponentsjs/webcomponents.min.js")" type="text/javascript"></script>
<link rel="import" href="@routes.Assets.at("elements/my-element.html")">

body部には以下の通り記述。

main.scala.html
<my-element></my-element>

そうするとこんな感じに表示されます。

スクリーンショット 2014-12-13 23.35.31.png

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3