Jamie
Jamie

Reputation: 321

how to use a Modal in my simple AngularJs controller

I'm not able to load the modal service into my simple rookie angular controller example, I've included the plunker below. Can anyone suggest what I'm doing wrong? any help much appreciated! Thanks

http://plnkr.co/edit/VVyMsRMVg5DzeqpnvWSQ?p=preview

code snippet

  app.controller('MainController', ['$scope', 'FService', 'angularModalService', function($scope, FService, angularModalService) {


  $scope.show = function() {
    angularModalService.showModal({
        templateUrl: 'modal.html',
        controller: "ModalController"
    }).then(function(modal) {
        modal.element.modal();
        modal.close.then(function(result) {
            $scope.message = "You said " + result;
        });
    });
  };
  }

Upvotes: 0

Views: 52

Answers (1)

batmaniac7
batmaniac7

Reputation: 422

I found this very helpful. Hope you do too.

http://weblogs.asp.net/dwahlin/building-an-angularjs-modal-service

Upvotes: 1

Related Questions