Custom section in backoffice - ng-model not passed back to controller
First of all: I'm very new to Umbraco backoffice extensions and AnguarJS.
What I have achieved, by following this series of articles, is to create a new section, show the content tree (left pane) and an angular form on the right. Here is the controller and view code:
The thing that is not working is passing the value of the < input ng-model="exportFilename" > back to the controller. As you can see, I'm trying to pass the value as a parameter to the ng-submit function "xmlExport", but this does not work, exportFilename is always undefined when entering the controller function. But, the other way is working fine: When initializing the $scope.exportFilename in the Controller, that value is shown in the < input> when entering the form.
I painfully aware that this problem is probably due to my lack of basic angular knowledge. However, I have spent most of the day on forums trying to figure it out, without any luck. While searching for an answer, I also got a feeling that it could be something special with Umbraco here, but I could be wrong.
So now, I'm hoping that some v7 backoffice guru here could help me out.
Custom section in backoffice - ng-model not passed back to controller
First of all: I'm very new to Umbraco backoffice extensions and AnguarJS.
What I have achieved, by following this series of articles, is to create a new section, show the content tree (left pane) and an angular form on the right. Here is the controller and view code:
edit.controller.js:
edit.html:
The thing that is not working is passing the value of the < input ng-model="exportFilename" > back to the controller. As you can see, I'm trying to pass the value as a parameter to the ng-submit function "xmlExport", but this does not work, exportFilename is always undefined when entering the controller function. But, the other way is working fine: When initializing the $scope.exportFilename in the Controller, that value is shown in the < input> when entering the form.
I painfully aware that this problem is probably due to my lack of basic angular knowledge. However, I have spent most of the day on forums trying to figure it out, without any luck. While searching for an answer, I also got a feeling that it could be something special with Umbraco here, but I could be wrong.
So now, I'm hoping that some v7 backoffice guru here could help me out.
Comment author was deleted
Hey, you don't need to pass it since it's available in $scope.exportFilename so you can just change the ng-submit to
and the function to
Ah, so simple! (I thought I had tried it, but obviously I didn't get it right.) Thanks a lot, Tim!
Comment author was deleted
No prob glad I could help :)
is working on a reply...