src/sap.ui.rta/src/sap/ui/rta/service/ControllerExtension.js
function(sViewId) {
					var oViewOverlay = OverlayRegistry.getOverlay(sViewId);
					if (!oViewOverlay) {
						throw DtUtil.createError("service.ControllerExtension#getTemplate", "no overlay found for the given view ID", "sap.ui.rta");
					}

					var sControllerExtensionTemplatePath = oViewOverlay.getDesignTimeMetadata().getControllerExtensionTemplate();
					return makeAjaxCall(sControllerExtensionTemplatePath + "-dbg")
					.catch(function() {
						return makeAjaxCall(sControllerExtensionTemplatePath);
					});
				}
function(sViewId) {
					var oViewOverlay = OverlayRegistry.getOverlay(sViewId);
					if (!oViewOverlay) {
						throw DtUtil.createError("service.ControllerExtension#getTemplate", "no overlay found for the given view ID", "sap.ui.rta");
					}

					var sControllerExtensionTemplatePath = oViewOverlay.getDesignTimeMetadata().getControllerExtensionTemplate();
					return makeAjaxCall(sControllerExtensionTemplatePath + "-dbg")
					.catch(function() {
						return makeAjaxCall(sControllerExtensionTemplatePath);
					});
				}
function ( sViewId ) { var oViewOverlay = OverlayRegistry . getOverlay ( sViewId ) ; if ( ! oViewOverlay ) { throw DtUtil . createError ( "service.ControllerExtension#getTemplate" , "no overlay found for the given view ID" , "sap.ui.rta" ) ; } var sControllerExtensionTemplatePath = oViewOverlay . getDesignTimeMetadata ( ) . getControllerExtensionTemplate ( ) ; return makeAjaxCall ( sControllerExtensionTemplatePath + "-dbg" ) . catch ( function ( ) { return makeAjaxCall ( sControllerExtensionTemplatePath ) ; } ) ; }
Gets the Controller Extension template from the DesignTimeMetadata of the given view and returns it as a string wrapped in a promise.
If there is no template specified, a default template will be returned.

@method sap.ui.rta.service.ControllerExtension.getTemplate
@param {string} sViewId ID of the view whose template should be retrieved
@return {Promise} Returns a promise that resolves with the template as string or rejects when the file was not found
@public
Gets the Controller Extension template from the DesignTimeMetadata of the given view and returns it as a string wrapped in a promise . If there is no template specified a default template will be returned .