If you want to write an AngularJs (1.5) component using Angular (>=2) approach, you could use:
import { FooComponent } from './foo.component';
angular.module('app.module', [])
.component('fooComponent', FooComponent);
import { NgModule } from '@angular/core'; | |
import { | |
WebBluetoothModule | |
} from '@manekinekko/angular-web-bluetooth'; | |
@NgModule({ | |
imports: [ | |
//..., | |
WebBluetoothModule.forRoot() | |
], | |
//... |
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs/Observable'; | |
// import BluetoothCore and types | |
import { | |
BluetoothCore, | |
BluetoothRemoteGATTServer, | |
BluetoothRemoteGATTService, | |
BluetoothRemoteGATTCharacteristic, | |
DataView | |
} from '@manekinekko/angular-web-bluetooth'; |
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { FormsModule } from '@angular/forms'; | |
import { HttpModule } from '@angular/http'; | |
import { AppComponent } from './app.component'; | |
@NgModule({ | |
declarations: [ |
/** | |
* Dependency Injector module. | |
* @type {Class} | |
* @author Wassim Chegham | |
*/ | |
class DI { | |
dependencies = {}; | |
modules = {}; | |
factory(ctor, deps) { | |
return new ctor.apply(ctor, deps); |
function checkPermutationWithSort(s1, s2) { | |
if (s1.length > 0 && s1.length === s2.length) { | |
return Array.from(s1).sort().join('') === Array.from(s2).sort().join(''); | |
} | |
return false; | |
} | |
function checkPermutationWithDatastructure(s1, s2) { | |
const m = {}; | |
for(let x=0; x<s1.length; x++) { |
<section> | |
{% if title %} | |
<h2>{{ title }}</h2> | |
{% endif %} | |
{{ content_1 }} | |
{% if content_2 %} | |
{{ content_2 }} | |
{% endif %} |
// this code sample is just for fun | |
// WARNING: don't write this ugly code in production | |
(async (a) => { | |
for await (const o of (async function* () {yield* await a })()) { | |
console.log(o); | |
} | |
})(Promise.all([1,2,3])); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<body> | |
<h2>Privacy Policy</h2> | |
<p>Wassim Chegham built [[ APPLICATION_NAME ]] as a open source app. This SERVICE is provided by Wassim Chegham at no cost and is intended | |
for use as is.</p> | |
<p>This page is used to inform website visitors regarding my policies with the collection, use, and | |
disclosure of Personal Information if anyone decided to use my Service.</p> |