Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dialog controller not working #33

Open
shangdiyisi opened this issue Dec 15, 2015 · 9 comments
Open

dialog controller not working #33

shangdiyisi opened this issue Dec 15, 2015 · 9 comments

Comments

@shangdiyisi
Copy link

Dialog controller not working

@shangdiyisi
Copy link
Author

Main page defined app, modal dialog defined controller. Main page' controller is ok, but modal dialog's controller is not working.

@shangdiyisi
Copy link
Author

Dialog's directive is ok, but modal dialog's controller is not working.

@shangdiyisi
Copy link
Author

@eriktufvesson @vlapo

@vlapo
Copy link
Contributor

vlapo commented Dec 16, 2015

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>

@shangdiyisi
Copy link
Author

@vlapo

app.controller('DialogCtrl', function($scope){
    $scope.testVar = 'Variable :)';
});

This controller dosnt work when I defined in template.html

@vlapo
Copy link
Contributor

vlapo commented Dec 16, 2015

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>

@shangdiyisi
Copy link
Author

Argument 'outsideUrlSwitchController' is not a function, got undefined

@shangdiyisi
Copy link
Author

@vlapo yes

@vlapo
Copy link
Contributor

vlapo commented Dec 16, 2015

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants