EmberScript is an actively used programming language created in 2012.

7Years Old 1,471Users 0Jobs

Example code from Linguist:

class App.FromNowView extends Ember.View
    tagName: 'time'
    template: Ember.Handlebars.compile '{{view.output}}'
    output: ~>
        return moment(@value).fromNow()

    didInsertElement: ->
        @tick()

    tick: ->
        f = ->
            @notifyPropertyChange 'output'
            @tick()

        nextTick = Ember.run.later(this, f, 1000)
        @set 'nextTick', nextTick

    willDestroyElement: ->
        nextTick = @nextTick
        Ember.run.cancel nextTick

Ember.Handlebars.helper 'fromNow', App.FromNowView

Edit

Last updated February 11th, 2019