dialog controller not working
Dialog controller not working
Main page defined app, modal dialog defined controller. Main page' controller is ok, but modal dialog's controller is not working.
Dialog's directive is ok, but modal dialog's controller is not working.
@eriktufvesson @vlapo
Hi, do you have any console output?
This example works for me:
script.js
var app = angular.module('myApp', ['ngBootbox']);
app.controller('MyCtrl', function($scope, $rootScope){
});
app.controller('DialogCtrl', function($scope){
$scope.testVar = 'Variable :)';
});
index.html
<a title="Edit" href=""
ng-bootbox-custom-dialog
ng-bootbox-custom-dialog-template="./template.html">Update This</a>
template.html
<form ng-controller="DialogCtrl">
{{testVar}}
</form>
@vlapo
app.controller('DialogCtrl', function($scope){
$scope.testVar = 'Variable :)';
});
This controller dosnt work when I defined in template.html
Define in template.html ??? Like this ?
<script type="text/javasctript">
app.controller('DialogCtrl', function($scope){
$scope.testVar = 'Variable :)';
});
</script>
<form ng-controller="DialogCtrl">
{{testVar}}
</form>
Argument 'outsideUrlSwitchController' is not a function, got undefined
@vlapo yes
This is no issue of ngBootbox. You just dont know hot to work with javascript or angular.
Javascript in templates html is not resolved, and app variable is undefined too. Define it as in my example (one js file included to index.html).