Few ways you can do this from the Collection, but whichever way you choose, you have to call destroy on each model, which will run sync and destroy it on both the client-side and server-side (which localStorage is acting as).
collection.each(function(model) {
model.destroy();
}
)
Update
Per comments, doesn't look like this works anymore. Since this is still marked as the answer, including answer that should work below, per skcin7
.
while ((model=collection.shift()))
{ model.destroy();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…