Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('myapp').service([function BarService() {
- this.bindOnThis = {
- muted: true,
- playing: false
- };
- }]);
- angular.module('myapp').controller(['$scope', 'BarService', function FooController($scope, BarService) {
- $scope.videoConfig = {
- muted: false,
- playing: false
- };
- $scope.barServiceConfig = BarService.bindOnThis;
- $scope.$watch('barServiceConfig.muted', function(newValue) {
- if (newValue) {
- $scope.videoConfig.muted = newValue;
- }
- });
- }]);
- <video video-dtv is-muted="videoConfig.muted", is-playing="videoConfig.playing" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement