The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
rm -r .git | |
git init | |
(create files) | |
git add -A | |
git commit -m 'Initial commit' | |
git remote add origin <url> | |
git push --force --set-upstream origin master |
/** | |
* @ngdoc Directive | |
* @name app.confirmOnExit | |
* | |
* @description | |
* Prompts user while he navigating away from the current route (or, as long as this directive | |
* is not destroyed) if any unsaved form changes present. | |
* | |
* @element Attribute | |
* @scope |
/** | |
* Format datetime | |
* Usage: | |
* new Date().format('yyyy/MM/dd'), new Date().format('hh:mm:ss') | |
* @param {String} format | |
* @return {String} | |
*/ | |
Date.prototype.format = function(format) { | |
var self = this; |
function objectToQuerystring (obj) { | |
return Object.keys.reduce(function (str, key, i) { | |
var delimiter, val; | |
delimiter = (i === 0) ? '?' : '&'; | |
key = encodeURIComponent(key); | |
val = encodeURIComponent(obj[key]); | |
return [str, delimiter, key, '=', val].join(''); | |
}, ''); | |
} |
angular.module('A').directive('formAutofillFix', function ($timeout) { | |
return function (scope, element, attrs) { | |
element.prop('method', 'post'); | |
if (attrs.ngSubmit) { | |
$timeout(function () { | |
element | |
.unbind('submit') | |
.bind('submit', function (event) { | |
event.preventDefault(); | |
element |
/** | |
* @ngDoc Directive | |
* @name app.Directive.onKeyEnter | |
* @module app | |
* | |
* @description | |
* this directive triggers callback function when enter key is pressed | |
* | |
* @author Mohan Singh <mslogicmaster@gmail.com> | |
* |
[{ | |
"name": "Afghanistan (افغانستان)", | |
"iso2": "af", | |
"dialCode": "93" | |
}, { | |
"name": "Albania (Shqipëri)", | |
"iso2": "al", | |
"dialCode": "355" | |
}, { | |
"name": "Algeria (الجزائر)", |
"use strict"; | |
var _ = require('lodash'); | |
/** | |
* Custom matchers for protractor and jasmine 2 | |
* | |
* expect(el).toBePresent(); | |
* expect(el).toBeDisplayed(); | |
* expect(el).toContainText('text to contain'); |