Created
June 2, 2015 02:32
-
-
Save jbnv/085ddf8b33ea1d7c1e87 to your computer and use it in GitHub Desktop.
Durandal viewmodel template
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
define(['durandal/app', 'durandal/system', 'knockout'], function (app, system, ko) { | |
var data = ko.observableArray(); | |
return { | |
data: data, | |
// Page events | |
activate: function () { | |
system.log('Lifecycle:activate'); | |
}, | |
binding: function () { | |
system.log('Lifecycle:binding'); | |
return { cacheViews: false }; //cancels view caching for this module, allowing the triggering of the detached callback | |
}, | |
bindingComplete: function () { | |
system.log('Lifecycle:bindingComplete'); | |
}, | |
attached: function (view, parent) { | |
system.log('Lifecycle:attached'); | |
}, | |
compositionComplete: function (view) { | |
system.log('Lifecycle:compositionComplete'); | |
}, | |
detached: function (view) { | |
system.log('Lifecycle:detached'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment