'use strict';
import $ from 'jquery';
window.$ = $;
import angular from 'angular';
window.angular = angular;
function myAppModule($rootScope, $http) {
alert(1);
}
myAppModule.$inject = ['$rootScope', '$http'];
let app = angular.module("myApp", []).run(myAppModule);
// ПОЧЕМУ super.model ЗДЕСЬ undefined
class A {
constructor() {
// ...
}
method() {
// ...
}
static sMethod() {
// ...
}
}
class B extends A {
constructor(x, y) {
super(x);
super.method(y);
}
}
function A() {
if(!(this instanceof A)) {
throw new Error('Class constructor A cannot be invoked without \'new\'');
}
// ...
}
A.prototype.constructor = A;
A.prototype.method = function method() {
// ...
};
A.sMethod = function sMethod() {
// ...
};
function B(x, y) {
if(!(this instanceof B)) {
throw new Error('Class constructor B cannot be invoked without \'new\'');
}
A.call(this, x);
A.prototype.method.call(this, y);
}
B.prototype = Object.create(A.prototype);
B.prototype.constructor = B;
B.sMethod = A.sMethod; //static методы тоже наследуются
function distantion(x1, y1, x2, y2) {
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
}
#!/bin/bash
rm $DIST_FILE
touch $DIST_FILE
for f in $(ls $SRC_DIR | grep .js)
do cat $SRC_DIR/$f >> $DIST_FILE
done
uglifyjs $DIST_FILE -cmo $DIST_FILE
SRC_DIR=$PWD/src/js DIST_FILE=$PWD/dist/script.js bash ./concat.sh
Для удобства лучше положить это в packaje.json в scripts.concat и запускать как npm run concat