Skip to content

Instantly share code, notes, and snippets.

@acidsound
Last active June 12, 2020 03:12
Show Gist options
  • Save acidsound/5b4b6612e7b21ca393278fd09b108377 to your computer and use it in GitHub Desktop.
Save acidsound/5b4b6612e7b21ca393278fd09b108377 to your computer and use it in GitHub Desktop.
meteor handson - create

meteor original

meteor create --bare ex1 && cd ex1
meteor remove static-html
meteor add blaza-html-template
mkdir client server lib
vi client/index.html
<body>
    {{> main}}
</body>

<template name="main">
    <h1>Hello Folks</h1>
</template>

meteor bare

meteor create --bare ex2 && cd ex2
mkdir client && cd client
mkdir lib && cd lib
vi index.html
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Index</title>
</head>
<body>
    <h1>Index</h1>
</body>
cd ..
vi about
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body>
    <h1>about</h1>
</body>
  • client/lib/index.html > client/about.html 순으로 로딩. head 도 마찬가지 순서로 적재한다.
  • Meteor 객체 살아있고 연결도 되있음. collection만들고 publish/subscribe하면 마찬가지로 적용됨

meteor default

  • js에 import './main.html'과 같은 진입점이 필요.
  • 기본예제처럼 import { Template } from 'meteor/templating';를 포함하지 않아도 작동.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment