Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Better error message with transclude / ng-transclude #3759

Closed
@rngadam

Description

@rngadam

Based on this transclude example: http://jsfiddle.net/ospatil/A969Z/

If we remove transclude: true from the directive (imagine that the programmer has forgotten it), this is the error message generated:

TypeError: undefined is not a function
    at new R.controller (http://code.angularjs.org/1.1.0/angular.min.js:145:411)
    at d (http://code.angularjs.org/1.1.0/angular.min.js:27:283)
    at Object.instantiate (http://code.angularjs.org/1.1.0/angular.min.js:27:413)
    at http://code.angularjs.org/1.1.0/angular.min.js:50:428
    at http://code.angularjs.org/1.1.0/angular.min.js:42:146
    at m (http://code.angularjs.org/1.1.0/angular.min.js:6:312)
    at k (http://code.angularjs.org/1.1.0/angular.min.js:42:8)
    at e (http://code.angularjs.org/1.1.0/angular.min.js:38:207)
    at k (http://code.angularjs.org/1.1.0/angular.min.js:42:253)
    at e (http://code.angularjs.org/1.1.0/angular.min.js:38:207) 

Suggest a better error message here:

ng-transclude directive called but no content to be transcluded - have you forgotten to set transclude: true?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions