Last active
December 1, 2015 08:38
-
-
Save tuchk4/eed3b6e58d52dac1d51e to your computer and use it in GitHub Desktop.
Valentjs vs AngularJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>' | |
}); | |
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeController { | |
name = 'home'; | |
constructor() { | |
} | |
} | |
valent.controller('home', HomeController); | |
valent.route('home', '/home', { | |
template: '<div> {{ controller.name }} </div>' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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