Reputation: 440
I want to use Angular.js with the Play Framework view helper functions (e.g @helper.form(...))
How do I insert an Angular directive (e.g: ng-controller)
Upvotes: 2
Views: 891
Reputation: 955
We're currently using Play Framework 2 and AngularJS.
We added a special method to handle this:
implicit class SymbolString( str: String ) {
def s = Symbol(str)
}
And then we just call it as such:
"ng-model".s -> "datasetName"
Upvotes: 1
Reputation: 1436
As I'm sure you discovered, you can't directly make a Scala Symbol
with a dash like 'some-word
. Instead, just wrap it:
scala> Symbol("ng-controller")
res4: Symbol = 'ng-controller
Upvotes: 2