It's a huge title, but it tells about everything, but let me clarify.
I have generator that produces a HTMLstring for an input field (range, checkbox, ...). This massive string then gets placed in the HTML via $templateCache.put('dynamicSettings, htmlString)
Example of a possible string:
var htmlString = "<input type='range' min='0' max='10' value='5' ng-model='sliderBrightness' ng-change='settingsInputChanged(sliderBrightness, 'sliderBrightness')'>";
When I hardcode this string in my HTML file, it works perfectly. The settingsInputChanged() function gets called and 2 parameters are passed, the value and the unique name. The function then saves the value in the localStorage with the keyvalue (2nd parameter).
But when adding the string dynamically, I get this massive error of which I presume has something to do with the fact that I'm passing a String in the ng-change.
rror: [$parse:syntax] Syntax Error: Token 'undefined' not a primary expression at column null of the expression [settingsInputChanged(sliderBrightness,] starting at [settingsInputChanged(sliderBrightness,].
Or maybe it can't handle that I have 2 '-pairs nested.
I'm guessing a better may of handling things might be available, but I can't seem to find anything related.
Aucun commentaire:
Enregistrer un commentaire