This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MOVED: https://github.com/matb33/meteor-collection-hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------------------------- | |
// THIS ALLOWS YOU TO DEFINE JADE SYNTAX AS FOLLOW | |
// ---------------------------------------------------------------------------- | |
// rules: you can use a helper inside jade with brackets, you can pass any arguments (i.e. another helpers) inside brackets | |
// Samples: | |
// +if anyHelper(arg1, arg2, arg3, ...) | |
// div(class=anyHelper(arg1, arg2, arg3, ...)) | |
// h1= anyHelper(arg1, arg2, arg3, ...) | |
// h1 #{anyHelper(arg1, arg2, arg3, ...)} | |
// ---------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Layers = App.Collection('layers'); | |
Layers.find().observeChanges({ | |
'added': function (id, fields) { | |
var doc = this.results._map[id]; | |
// now we could access and modify the doc | |
// --------------------------------------------------------------------- | |
// here I wanna know a type of the layer and then fill some default | |
// properties for doc |