Advertisement
Guest User

Untitled

a guest
Jun 18th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. VariableLayer.coffee ---------------------------
  2.  
  3. class exports.VariableLayer extends Layer
  4.     # initialization
  5.     constructor: (@options={}) ->
  6.         @options = _.defaults @options,
  7.             @options.myVar ?= "a variable"
  8.    
  9.         super @options
  10.        
  11.         exports.myVar = @options.myVar
  12.  
  13. app.coffee ------------------------------------
  14.  
  15. {VariableLayer} = require "VariableLayer"
  16. myVariableLayer = new VariableLayer
  17. print myVariableLayer.myVar
  18.  
  19. -----------------------------------------------
  20.  
  21. result is undefined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement