ocombe / ocModal

An angularJS modal directive & service
66 stars 16 forks source link

controllerAs syntax #9

Open jmls opened 9 years ago

jmls commented 9 years ago

is the controllerAs syntax is this supported at all ?

I have this

 $ocModal.open({
                    url: "someurl",
                    controller: "myController as controller",
                    init: {foo: "bar"},
                });

but my controller doesn't have any properties defined

ocombe commented 9 years ago

Hmm I'm not sure, but it's possible that it's not, I didn't know about this syntax when I wrote the lib, and I haven't updated it since then :)

benjamincharity commented 9 years ago

:+1:

jakemulley commented 8 years ago

+1

ocombe commented 8 years ago

It "almost" works with controller as, you have to set isolate: true and use $init in your controller to access the init properties, you can even use angular.extend to merge them in your "this" if you want