Skip to content

ECMAScript 6 boilerplate for angular source code and webpack

License

Notifications You must be signed in to change notification settings

maxmaximov/angular-es6

 
 

Repository files navigation

Angular ECMAScript 6 boilerplate

Do you want to use ES6 with angular and webpack? Here is a simple project with everything what you need at the beginning

Instalation

npm install angular-es6

Examples

Here is multiple examples:

Directive

export default class NiceDirective {
    constructor($http) {
    	this.$http = $http;

        this.template = '<div>{{computeName('NICE')}}</div>'; 
        this.restrict = 'E'; 
        this.scope = {
        	name: '='
    	};
    } 

    link($scope, element, attrs) { 
        this.$scope = $scope;

        $scope.computeName = suffix => computeName(suffix);
    } 

    computeName(suffix = '') {
    	const $scope = this.$scope;

    	return 'Mr.'   $scope.name   ' '    suffix;
    }
}

NiceDirective.$inject = ['$http'];

Controller

export default class MainController {
	constructor($scope) {
		this.$scope = $scope;
	}
}

MainController.$inject = ['$scope'];

Run build for production

npm run build

Run build for development

npm run dev

About

ECMAScript 6 boilerplate for angular source code and webpack

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 90.8%
  • HTML 8.1%
  • CSS 1.1%