I'm using Famo.us + Angular. I'm able to retrieve the classList of a Surface by doing this:
$scope.findElement = function() {
var elem = $famous.find("#colored-bg")[0].renderNode; // Returns Surface
console.log(elem.classList); // RETURNS: ["purple-bg", "container-border", "box-shadow"]
};
You can't perform any of the operations on Famo.us object which you normal could to any other object on the DOM. For example, I thought I could add, remove, or replace classes, similar to this:
document.getElementById('id').classList.add('class');
document.getElementById('id').classList.remove('class');
add and remove do not exist, though. I can return the class list, and even individual items from the list (ex: Just the first class), but you cannot alter it. Any suggestions?
The
setClasses
method takes an array and you can set classes using:Use
addClass
by passing the class name to add a class using:Use
removeClass
by passing the class name to remove a class using:Use
toggleClass
by passing the class name to add/remove based on whether it exists: