Bind on scroll event angular way.
<div on-scroll="scrollHdlr($direct,$event)">angular.module("app").controller('ctrl', function ($scope) {| const htmlparser2 = require('htmlparser2') | |
| const define = (src, ...args) => { | |
| if (!args.length) args.push(src) | |
| const [configurable, enumerable] = [true, false] | |
| args.forEach(obj => { | |
| const keys = Object.entries(obj) | |
| .map(([key, value]) => ({ [key]: { value, configurable, enumerable } })) | |
| Object.defineProperties(src, Object.assign(...keys)) | |
| }) | |
| return src |
| function dfsXyConv (code, v1, v2) { | |
| const { PI, tan, log, cos, pow, floor, sin, sqrt, atan, abs, atan2 } = Math | |
| // | |
| // LCC DFS 좌표변환을 위한 기초 자료 | |
| // | |
| const RE = 6371.00877 // 지구 반경(km) | |
| const GRID = 5.0 // 격자 간격(km) | |
| const SLAT1 = 30.0 // 투영 위도1(degree) | |
| const SLAT2 = 60.0 // 투영 위도2(degree) | |
| const OLON = 126.0 // 기준점 경도(degree) |
| const entities = { | |
| lt: '<', | |
| gt: '>', | |
| amp: '&', | |
| quot: '"', | |
| apos: `'`, | |
| cent: '¢', | |
| pound: '£', | |
| yen: '¥', | |
| euro: '€', |
| const _ = require('lodash') | |
| function isPromise(result) { | |
| return result && (typeof result.then === 'function') | |
| } | |
| function seq(init) { | |
| let result = typeof init === 'function' ? init() : init | |
| let properties = {value: {get() { return result }}} | |
| _.forEach(['then', 'catch', 'finally'], x => { properties[x] = {get() { return (...args) => result[x](...args) }} }) |
| let lodash = _.runInContext() | |
| export let wrapLodashArrForVue = _(['pull', 'pullAll', 'pullAllBy', 'pullAllWith', 'pullAt', 'remove']) | |
| .map(fnName => { | |
| let fn = lodash[fnName] | |
| return [ | |
| fnName, | |
| function (v, …args) { | |
| let ret = fn(v, …args) | |
| if (v instanceof Array) v.push() | |
| return ret |
| export function Deferred () { | |
| this.promise = new Promise((resolve, reject) => Object.assign(this, {resolve, reject})) | |
| } |
| var crypto = require('crypto'); | |
| var SHA256 = require('./SHA256.js'); | |
| var Base64 = require('./Base64.js'); | |
| var _key = SHA256.encode('default key'); | |
| module.exports = { | |
| encode: function (data, key) { | |
| if (arguments.length < 2) key = _key; | |
| var cipher = crypto.createCipher('aes-256-ctr', key); // Cipher 객체 생성 | |
| var crypted = Buffer.concat([cipher.update(new Buffer(data)), cipher.final()]); | |
| return Base64.encode(crypted); |
##Example
var p = new path('http://abc.com/aa/bb/cc');
p.cd('../../ww');
p.toString();
//returns "http://abc.com/aa/ww"
p.cd('/').toString();
//returns "http://abc.com"