-
Notifications
You must be signed in to change notification settings - Fork 20
Configure TemplateBegin #36
Copy link
Copy link
Open
Description
Hi
In my case I have typescript directive which we convert to js and then apply angular embed template on it. Our case template is not beginning with template: or template:string= rather it is template= see below code. Can we configure TemplateBegin from options so that end user can pass it ?
module SplashScreen {
export class SplashScreenDirective implements ng.IDirective {
public restrict: string;
public controller: string;
public templateUrl: string;
public scope: any;
public link: (scope: any, instanceElement: any, instanceAttributes: ng.IAttributes) => void;
public static $inject: string[] = ["baseUrl"];
constructor(baseUrl: string) {
this.restrict = 'E';
this.controller = 'splashScreenController';
this.templateUrl = 'js/infrastructure/splashscreen/splashscreen.template.html';
this.scope = {
showError: '=?'
};
this.link = ($scope) => {
$scope.$watch(() => { return $scope.showError; }, (value) => {
if (value) {
$scope.onShowingError();
}
});
};
}
}
SplashScreen.Module.directive('splashScreen', ['baseUrl', (baseUrl) => new SplashScreenDirective(baseUrl)]);
}
Compiled JavaScript:
```javascript
"use strict";
var SplashScreen;
(function (SplashScreen) {
var SplashScreenDirective = /** @class */ (function () {
function SplashScreenDirective(baseUrl) {
this.restrict = 'E';
this.controller = 'splashScreenController';
this.templateUrl = 'js/infrastructure/splashscreen/splashscreen.template.html';
this.scope = {
showError: '=?'
};
this.link = function ($scope) {
$scope.$watch(function () { return $scope.showError; }, function (value) {
if (value) {
$scope.onShowingError();
}
});
};
}
SplashScreenDirective.$inject = ["baseUrl"];
return SplashScreenDirective;
}());
SplashScreen.SplashScreenDirective = SplashScreenDirective;
SplashScreen.Module.directive('splashScreen', ['baseUrl', function (baseUrl) { return new SplashScreenDirective(baseUrl); }]);
})(SplashScreen || (SplashScreen = {}));Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels