While the code below "works", it definitely feels very wrong. Is there a "best practices" way to refactor? The issue is that I'm passing an instance of the controller into an isolate scope directive
(note: I can't use this in the directive:
controller: 'ViewController', controllerAs: 'viewCtrl',
because I need the same instance of the controller..)
It may just be the case that I didn't set this up correctly in the first place, but curious to know if there is a good way to "refactor" this
UI-Router config:
.state('someState', {
url: '/someurl',
views: {
'' : {
templateUrl: '/path/to/template.html',
controller: 'ViewController',
controllerAs: 'viewCtrl'
},
The Directive
<some-dirctive
view-ctrl="viewCtrl">
</some-dirctive>