UNPKG

@titanium/turbo

Version:

<p align="center"> <img src="https://cdn.secure-api.org/images/turbo-title_400.png" /><br> <a href="https://www.npmjs.com/package/@titanium/turbo"> <img src="https://img.shields.io/npm/v/@titanium/turbo.png" /> </a> </p>

14 lines (13 loc) 563 B
Alloy.Collections.fighters = Alloy.createCollection('fighters'); // typically we'd do this in a migration, but let's test it here // to make sure that custom idAttributes of type TEXT actually // work as expected. var fighters = [ { name: 'Wanderlei Silva', nickname: 'The Axe Murderer', fighterId: 'wandy' }, { name: 'Manny Pacquiao', nickname: 'Pac-Man', fighterId: 'manny' }, { name: 'Muhammad Ali', nickname: 'The Greatest', fighterId: 'ali' } ]; _.each(fighters, function(fighter) { var model = Alloy.createModel('fighters', fighter); model.save(); });