Skip to content

Instantly share code, notes, and snippets.

@tuchk4
Last active December 1, 2015 08:38
Show Gist options
  • Save tuchk4/eed3b6e58d52dac1d51e to your computer and use it in GitHub Desktop.
Save tuchk4/eed3b6e58d52dac1d51e to your computer and use it in GitHub Desktop.
Valentjs vs AngularJS
angular.module('example').controller('home', ['$scope', function($scope) {
$scope.name = 'home';
});
angular.module('example').config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/home', {
controller: 'home',
template: '<div> {{ name }} </div>'
});
}]);
class HomeController {
name = 'home';
constructor() {
}
}
valent.controller('home', HomeController);
valent.route('home', '/home', {
template: '<div> {{ controller.name }} </div>'
});
class HomeController {
name = 'home';
constructor() {
}
}
valent.controller('home', HomeController, {
url: '/home',
template: '<div> {{ controller.name }} </div>'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment