Hi Kevin,
I made some progress still not there
Scope of Work : We have multiple href links. Each link should open its own
dialog. Hence i want to move the dialog views into separate partial html's.
Issue :
If I use the ng-include then the dialog doesnt pop up but works if it is
included inline ( yellow). The issue is ng-include starts its own scope .
What are my other options if I want to move the html Content to another
View. Also is it a good coding practice to have references of the dialogs
in the controller.
*index.html*
<!DOCTYPE html>
<html>
<head>
<title>jQuery Dialogs Demo</title>
<!--Start : jQuery Script Includes-->
<link rel="stylesheet"
href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css"
/>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<!--End : jQuery Script Includes-->
</head>
<body ng-app="myApp">
<div ng-controller="navigationController">
<a href="#" ng-click="open()">{{message}}</a>
<div ng-include="'customDialog.html'"
ng-controller="navigationController"></div>
* <!--<div id="modalToOpen" title="My Title">*
* Dialog Text*
* </div>-->*
</div>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular-route.min.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular-resource.min.js"></script>
<script src="app.js"></script>
</body>
</html>
*app.js *
var myApp = angular.module('myApp', []);
myApp.controller('navigationController', function ($scope) {
$scope.message = 'Open dialog';
var dialog = $("#modalToOpen").dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true
});
$scope.open = function () {
dialog.dialog("open");
}
});
*customDialog.html*
<div id="modalToOpen" title="My Title">
Dialog Text
</div>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.