Hey guys,

I'm trying to implement an modal window with a controller to update and 
delete same data. It's not working though. This is the error: 

Error: [$injector:unpr] 
http://errors.angularjs.org/1.2.14/$injector/unpr?p0=%24modalProvider%20%3C-%20%24modal


Here I have my modalDetailController

> moduleApp.controller('modalDetailController', function ($scope, $modal, 
> $log) {
>     $scope.items = ['item1', 'item2', 'item3'];
>     
>     $scope.open = function () {
>     
>       var modalInstance = $modal.open({
>         templateUrl: 'contactDetailModel.html',
>         controller: 'ModalInstanceController',
>         resolve: {
>           items: function () {
>             return $scope.items;
>           }
>         }
>       });
>     
>       modalInstance.result.then(function (selectedItem) {
>         $scope.selected = selectedItem;
>       }, function () {
>         $log.info('Modal dismissed at: ' + new Date());
>       });
>     };
> });
>   
> moduleApp.controller('ModalInstanceController', function ($scope, 
> $modalInstance, items) {
>     $scope.items = items;
>     $scope.selected = {
>       item: $scope.items[0]
>     };
>   
>     $scope.ok = function () {
>       $modalInstance.close($scope.selected.item);
>     };
>   
>     $scope.cancel = function () {
>       $modalInstance.dismiss('cancel');
>     };
> });


My contact domain modal:

<div class="modal-header">
>             <h3>I'm a modal!</h3>
>         </div>
>         <div class="modal-body">
>             <ul>
>                 <li ng-repeat="item in items">
>                     <a ng-click="selected.item = item">{{ item }}</a>
>                 </li>
>             </ul>
>             Selected: <b>{{ selected.item }}</b>
>         </div>
>         <div class="modal-footer">
>             <button class="btn btn-primary" ng-click="ok()">OK</button>
>             <button class="btn btn-warning" 
> ng-click="cancel()">Cancel</button>
>         </div>

 

I'm following this example on the internet ... but I'm not able to do.

If someone could help me or give me a good example I'll ge grateful.

Thanks in advance guys !

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

Reply via email to