JSFiddle - React, Tailwind, and code Playground
by spechackers
HTML
<div ng-app="myApp" ng-controller="TestCtrl as test">
<h1>Hello from {{test.getName()}}, and its version is {{test.getVersion()}}!</h1>
</div>
JavaScript
(function(ng, app){
app = angular.module('myApp', []);
app.config(function($provide) {
$provide.constant('appName', 'My App');
});
app.constant("config", {
appVersion: 1.0
});
app.controller('TestCtrl', [
'appName', 'config',
function MainCtrl(name, config) {
this.getName = function() {
return name;
};
this.getVersion = function() {
return config.appVersion;
};
}
]);
}(angular));