Skip to main content
Improved explaination
Source Link
georgeawg
  • 49k
  • 13
  • 77
  • 98

Delete the return statement in the service:

angular
.module('commons')
.service('MediaService', function () {

    this.selectedMedia = {}
    this.isPlaying = false

    //DELETE the return statement    
    ̶r̶e̶t̶u̶r̶n̶

    //OR

    return this;    
})

By using a return statement without a value, the constructor function returns a value of undefined. Without a return statement, the constructor will automatically returnreturns the this object created by the new operator.


The string needs quotes:

div.content
    video(
        controls
        ng-if="MediaService.selectedMedia.type !=  ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="video/mp4"
        )

    audio(
        ng-if="MediaService.selectedMedia.type ==   ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="audio/mp3"
        )

Without quotes the media type is being compared to $scope.audio which is undefined.

Delete the return statement in the service:

angular
.module('commons')
.service('MediaService', function () {

    this.selectedMedia = {}
    this.isPlaying = false

    //DELETE the return statement    
    ̶r̶e̶t̶u̶r̶n̶

    //OR

    return this;    
})

By using a return statement without a value, the constructor function returns a value of undefined. Without a return statement, the constructor will automatically return the this object created by the new operator.


The string needs quotes:

div.content
    video(
        controls
        ng-if="MediaService.selectedMedia.type !=  ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="video/mp4"
        )

    audio(
        ng-if="MediaService.selectedMedia.type ==   ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="audio/mp3"
        )

Without quotes the media type is being compared to $scope.audio which is undefined.

Delete the return statement in the service:

angular
.module('commons')
.service('MediaService', function () {

    this.selectedMedia = {}
    this.isPlaying = false

    //DELETE the return statement    
    ̶r̶e̶t̶u̶r̶n̶

    //OR

    return this;    
})

Without a return statement, the constructor automatically returns the this object created by the new operator.


The string needs quotes:

div.content
    video(
        controls
        ng-if="MediaService.selectedMedia.type !=  ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="video/mp4"
        )

    audio(
        ng-if="MediaService.selectedMedia.type ==   ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="audio/mp3"
        )

Without quotes the media type is being compared to $scope.audio which is undefined.

Added additional explaination
Source Link
georgeawg
  • 49k
  • 13
  • 77
  • 98

Delete the return statement in the service:

angular
.module('commons')
.service('MediaService', function () {

    this.selectedMedia = {}
    this.isPlaying = false

    //DELETE the return statement    
    ̶r̶e̶t̶u̶r̶n̶

    //OR

    return this;    
})

By using a return statement without a value, the constructor function returns a value of undefined. Without a return statement, the constructor will automatically return the this object created by the new operator.


The string needs quotes:

div.content
    video(
        controls
        ng-if="MediaService.selectedMedia.type !=  ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="video/mp4"
        )

    audio(
        ng-if="MediaService.selectedMedia.type ==   ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="audio/mp3"
        )

Without quotes the media type is being compared to $scope.audio which is undefined.

Delete the return statement in the service:

angular
.module('commons')
.service('MediaService', function () {

    this.selectedMedia = {}
    this.isPlaying = false

    //DELETE the return statement    
    ̶r̶e̶t̶u̶r̶n̶

    //OR

    return this;    
})

By using a return statement without a value, the constructor function returns a value of undefined. Without a return statement, the constructor will automatically return the this object created by the new operator.

Delete the return statement in the service:

angular
.module('commons')
.service('MediaService', function () {

    this.selectedMedia = {}
    this.isPlaying = false

    //DELETE the return statement    
    ̶r̶e̶t̶u̶r̶n̶

    //OR

    return this;    
})

By using a return statement without a value, the constructor function returns a value of undefined. Without a return statement, the constructor will automatically return the this object created by the new operator.


The string needs quotes:

div.content
    video(
        controls
        ng-if="MediaService.selectedMedia.type !=  ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="video/mp4"
        )

    audio(
        ng-if="MediaService.selectedMedia.type ==   ̶a̶u̶d̶i̶o̶  ͟'͟a͟u͟d͟i͟o͟'͟ "
    )
        source(
            ng-src="{{MediaService.selectedMedia.url}}"
            type="audio/mp3"
        )

Without quotes the media type is being compared to $scope.audio which is undefined.

Source Link
georgeawg
  • 49k
  • 13
  • 77
  • 98

Delete the return statement in the service:

angular
.module('commons')
.service('MediaService', function () {

    this.selectedMedia = {}
    this.isPlaying = false

    //DELETE the return statement    
    ̶r̶e̶t̶u̶r̶n̶

    //OR

    return this;    
})

By using a return statement without a value, the constructor function returns a value of undefined. Without a return statement, the constructor will automatically return the this object created by the new operator.