Skip to content

Commit

Permalink
Fix for #38
Browse files Browse the repository at this point in the history
  • Loading branch information
Malte Legenhausen committed Jul 21, 2014
1 parent 92d1c06 commit 8120d49
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ grunt.initConfig({
'key1': 'value1',
'key2': 42
},
'constant2': function () { // Exec function first on task run
return 'some lazy return value'
}
'constant2': 'value2'
}
}
},
Expand All @@ -188,7 +186,7 @@ angular.module("someModule", ["dep1", "dep2"])
"key2": 42
})

.constant("constant2", "some lazy return value")
.constant("constant2", "value2")

;
```
Expand All @@ -209,6 +207,24 @@ grunt.initConfig({
})
```

Or if you want to calculate the constants value at runtime you can create a lazy evaluated method:

```js
grunt.initConfig({
ngconstant: {
options: {
dest: 'dist/module.js',
name: 'someModule'
},
dist: {
constants: function () {
return new Date();
}
}
},
})
```

#### Wrap Option

The `wrap` option allows you to encapsulate the module in a closure. Simply set `wrap` to `true`.
Expand Down

0 comments on commit 8120d49

Please sign in to comment.