angular-es6
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -23,3 +23,3 @@ export default function createDirectiveFactory(Directive) { | ||
instance.controller.$inject = controllerOrg.$inject || []; | ||
instance.controller.$inject = controllerOrg.$inject || ['$scope', '$element']; | ||
} | ||
@@ -26,0 +26,0 @@ |
{ | ||
"name": "angular-es6", | ||
"description": "ECMAScript 6 boilerplate for angular source code and webpack", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -9,8 +9,59 @@ # Angular ECMAScript 6 boilerplate | ||
- npm install | ||
```sh | ||
npm install angular-es6 | ||
``` | ||
## Examples | ||
Here is multiple examples: | ||
### Directive | ||
```js | ||
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 | ||
```js | ||
export default class MainController { | ||
constructor($scope) { | ||
this.$scope = $scope; | ||
} | ||
} | ||
MainController.$inject = ['$scope']; | ||
``` | ||
## Run build for production | ||
- npm run build | ||
```sh | ||
npm run build | ||
``` | ||
@@ -20,3 +71,4 @@ | ||
- npm run dev | ||
```sh | ||
npm run dev | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9853
72