isteven / angular-multi-select

A multi select dropdown directive for AngularJS. Allows you to use HTML tags and CSS in the data. Requires only AngularJS and nothing else.
isteven.github.io/angular-multi-select
MIT License
1.08k stars 518 forks source link

Outputmodel with rootscope #458

Closed mhortac closed 7 years ago

mhortac commented 8 years ago

How can i use outputmodel with $rootScope ? I want to set/get the outputmodel value from any controller

isteven commented 8 years ago

Hi @mhortac ,

By default it will use $scope variable.. A dirty solution is to use the directive's on-change callback to update (copy) the values into a $rootScope variable. Read more about on-change in the manual.

Another (and usually recommended) way to set/get value from another controller is by using factory method.