From a terminal run the following commands:
git clone git@github.com:emberjs/ember.js
cd ember.js
npm install
npm start
While that is running open another terminal and run the following (starting from the ember.js
folder you cloned a moment ago):
import StartApp | |
import Http | |
import Markdown | |
import Html exposing (Html, div, button, text) | |
import Html.Events exposing (onClick) | |
import Task exposing (Task) | |
import Effects exposing (Effects) | |
-- the URL of the README.md that we desire | |
readmeUrl : String |
App.Router.map(function() { | |
this.resource('post', { path: '/posts/:post_id' }); | |
}); | |
App.PostRoute = Ember.Route.extend({ | |
model: function(params) { | |
return this.store.find('post', params.post_id); | |
} | |
}); |
module SuperTimer where | |
import Html exposing (..) | |
import Html.Events exposing (onClick) | |
import Time exposing (Time) | |
import Signal exposing (Address) | |
type Action = Tick Time | Toggle Bool | NoOp | |
type alias Model = { running: Bool, count: Float} |
import Html | |
import Html.App as App | |
import Html.Attributes as Attributes | |
import Html.Events as Events | |
import Json.Decode as Json | |
import String | |
main = | |
App.beginnerProgram |
From a terminal run the following commands:
git clone git@github.com:emberjs/ember.js
cd ember.js
npm install
npm start
While that is running open another terminal and run the following (starting from the ember.js
folder you cloned a moment ago):
-- the type aliases would be private | |
type RichText | |
= RichText (List Line) | |
type alias Line = | |
{ left : List (Attributes, String) | |
, center : List (Attributes, String) | |
, right : List (Attributes, String) |
-- See this document for more information on making Pong: | |
-- http://elm-lang.org/blog/pong | |
import Color exposing (..) | |
import Collage exposing (..) | |
import Element exposing (..) | |
import Keyboard | |
import Text | |
import Time exposing (..) | |
import Window exposing (Size) | |
import Html.App as App |
-- Assuming we have a list of items in the model (type alias Model = { items : List Item } | |
-- where Item is a record like { id : Int, name : String } | |
-- this goes in the view and generates an html dropdown | |
select | |
[ onSelect ValueSelectedMsg ] | |
(List.map (\item -> option [ value (toString item.id) ] [ text item.name ]) model.items) | |
targetSelectedIndex : Json.Decoder Int |
Glance through a few of the examples, maybe 5 or so, to see what kinds of things Elm is doing, what domains they're in, what the code looks like, what other people think Elm is.
module DragTable exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import Json.Decode as Json exposing (Decoder, Value) | |
import Dict exposing (Dict) | |
import List as L exposing (drop, take) | |
import Tuple |