Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Register `hello` component, along with its associated controller and template
- angular.
- module('hello').
- component('hello', {
- templateUrl: 'components/hello/hello.template.html',
- controller: [ '$log', function Hello($log) {
- this.name = 'world';
- this.countries = [
- {name: 'France', population: 63},
- {name: 'UK', population: 61}
- ];
- this.uppercase = function uppercase() {
- this.name = this.name.toUpperCase();
- }
- this.lowercase = function uppercase() {
- this.name = this.name.toLowerCase();
- }
- this.remaining = function remaining() {
- $log.info("plop");
- return 10 - this.name.length;
- }
- this.hasValidLength = function hasValidLength() {
- return this.name.length < 10;
- }
- }
- ]
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement