Minimal steps required to create a custom elemenet in Polymer 1.0, without any aid from tools like Yeoman and Gulp.
I have used the Quick tour of Polymer as a reference.
- Install Node.
(function () { | |
describe("Array", function () { | |
it("Array reverse()", function () { | |
expect("sgniht").toBe("things".split("").reverse().join("")); | |
}); | |
it("Array sort()", function () { |
import { Injectable } from '@angular/core'; | |
import { async, inject, TestBed } from '@angular/core/testing'; | |
import { MockBackend, MockConnection } from '@angular/http/testing'; | |
import { | |
Http, HttpModule, XHRBackend, ResponseOptions, | |
Response, BaseRequestOptions | |
} from '@angular/http'; | |
@Injectable() | |
class MetaManager {} |
Minimal steps required to create a custom elemenet in Polymer 1.0, without any aid from tools like Yeoman and Gulp.
I have used the Quick tour of Polymer as a reference.
<!doctype html> | |
<html> | |
<head> | |
<title>Polymer and RequireJS</title> | |
<script src="http://polymer.github.io/cdn/polymer.min.js"></script> | |
</head> | |
<body> | |
<!-- #foo --> | |
<div id="foo">the foo has no joy.</div> | |
capabilities: [ | |
{ browserName: 'phantomjs', | |
"phantomjs.page.settings.userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.1.54 (KHTML, like Gecko) Version/9.0 Safari/601.1.54", | |
"proxy": { | |
"proxyType":"MANUAL", | |
"httpProxy":"HOST:PORT" | |
} | |
} | |
] | |
var client = require("webdriverio").remote({ | |
desiredCapabilities: { | |
browserName: 'chrome', | |
chromeOptions: { | |
args: ['window-size=2880,1800'] | |
} | |
} | |
}) |
<link rel="import" href="../../bower_components/polymer/polymer.html"> | |
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html"> | |
<link rel="import" href="../../bower_components/paper-input/paper-input.html"> | |
<dom-module id="ajax-multiple"> | |
<template> | |
<section id="content"> | |
<paper-input id="post" label="Post" value="{{title}}" on-blur="resolve"> | |
</paper-input> |
describe("getTweets - Server", function () { | |
var server, fakeData = [ /* ... */ ]; | |
before(function () { | |
// Doesn’t work :( It’s JSONP! | |
server = sinon.fakeServer.create(); | |
server.respondWith( | |
"GET", | |
"https://api.twitter.com/.../elijahmanor.json?count=5", | |
[200, { "Content-Type": "application/json" }, JSON.stringify(fakeData)] |
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="http://cdn.kendostatic.com/2013.1.514/styles/kendo.common.min.css" rel="stylesheet" type="text/css" /> | |
<link href="http://cdn.kendostatic.com/2013.1.514/styles/kendo.default.min.css" rel="stylesheet" type="text/css" /> | |
<script src="http://cdn.kendostatic.com/2013.1.514/js/jquery.min.js"></script> | |
<script src="http://cdn.kendostatic.com/2013.1.514/js/kendo.all.min.js"></script> | |
</head> | |
<body> | |
Small script for development + builds with browserify.
Uses loose-envify
for faster inlining and cross-env
to handle windows/unix shells.
Dev features:
Build features: