HAML understands the basic hash for the "data" keyword, so:
%div{ data: { id: "5", name: "carsten" } }
equivalently
%div{ 'data-id' => "5", 'data-name' => "carsten" }
IMHO the previous syntax is much more readable.
AngularJS uses many ng-something attributes. Is it possible to configure HAML to:
%html{ 'ng-app' => "myApp", 'ng-controller' => "myCtrl" }
can be written as
%html{ ng: { app: "myApp", controller: "myCtrl" } }
source
share