@vivareal/ng-listen
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -8,7 +8,6 @@ 'use strict' | ||
const uglify = require('rollup-plugin-uglify') | ||
const packageJson = require('./package.json') | ||
const uglifyJS = require('uglify-js') | ||
const utils = require('./src/utils/utils') | ||
const config = require('./config.json') | ||
module.exports = { | ||
@@ -20,3 +19,3 @@ globals: { | ||
useStrict: true, | ||
moduleName: utils.camelize(packageJson.name), | ||
moduleName: config.moduleName, | ||
external: ['angular'], | ||
@@ -36,3 +35,3 @@ entry: 'src/export.js', | ||
commonjs({ | ||
include: ['src/**', 'node_modules/**'] | ||
include: ['src/**', 'node_modules/**', './gulp-rollup-config'] | ||
}) | ||
@@ -39,0 +38,0 @@ ], |
{ | ||
"name": "@vivareal/ng-listen", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An event listener abstraction directive for AngularJS", | ||
@@ -41,3 +41,4 @@ "main": "dist/cjs/ngListen.js", | ||
"src", | ||
"dist" | ||
"dist", | ||
"config.json" | ||
], | ||
@@ -44,0 +45,0 @@ "devDependencies": { |
import angular from 'angular' | ||
import { name } from '../package.json' | ||
import { camelize } from './utils/utils' | ||
import { moduleName } from '../config.json' | ||
const moduleName = camelize(name) | ||
/** | ||
@@ -8,0 +5,0 @@ * @ngdoc overview |
@@ -63,5 +63,7 @@ import 'core-js/es6/symbol' | ||
function onEventTriggered ($scope, e, fnExp) { | ||
$scope.$event = e | ||
$scope.$eval(fnExp) | ||
delete $scope.$event | ||
$scope.$applyAsync(() => { | ||
$scope.$event = e | ||
$scope.$eval(fnExp) | ||
delete $scope.$event | ||
}) | ||
} |
@@ -10,2 +10,3 @@ import angular from 'angular' | ||
let $rootScope | ||
let $browser | ||
@@ -15,5 +16,6 @@ let outsideScope | ||
beforeEach(inject((_$compile_, _$rootScope_) => { | ||
beforeEach(inject((_$compile_, _$rootScope_, _$browser_) => { | ||
$compile = _$compile_ | ||
$rootScope = _$rootScope_ | ||
$browser = _$browser_ | ||
@@ -36,4 +38,5 @@ createSubject("<button ng-listen=\"{'click': 'listen($event)'}\">Click Me!</button>") | ||
$subject[0].dispatchEvent(event) | ||
$browser.defer.flush() | ||
expect(outsideScope.listen).toHaveBeenCalledWith(event) | ||
}) | ||
}) |
import './module.spec' | ||
import './ngListen/ngListen.spec' | ||
import './utils/utils.spec' |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1300642
25
7525