If my directive uses "require
" to use a different directive, say ngModel
, and uses isolate scope how am I able to use the bindToController
syntax and still be able to access the injectables (ngModelController
) from the controller?
相关问题
- angularJS: ui-router equivalent to $location.searc
- Separate AngularJS Controllers Into Separate Files
- Angular ngAnimate not working first time on page l
- Ionic Spinner not showing up
- Upload file to Google Cloud Storage using AngularJ
相关文章
- Passing variable through URL with angular js
- Watch entire object (deep watch) with AngularJS
- Angular ng-if change span text
- Can ng-show directive be used with a delay
- AngularJS $routeParams vs $stateParams
- Multiple parameters in AngularJS $resource GET
- How to set class/style of accordion heading in Ang
- PUT to S3 with presigned url gives 403 error
How would you do this without
bindToController
? All thatbindToController: true
does is it binds the isolate scope propertyscope: { prop: "=" }
to the property of the controller:this.prop
.In both cases, the way to pass a "required" controller would be the same, which is to
require
your own controller and set its property to whatever you want, including other controllers: