Last active
June 1, 2017 08:06
Revisions
-
mhevery revised this gist
Dec 19, 2015 . 5 changed files with 82 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ // https://gist.github.com/mhevery/4b1bdb59a8c16f9cbe76 /// <reference path="probe.d.ts" /> /////////////////////// /// WORK IN PROGRESS // /////////////////////// var appRef: ApplicationRef = ng.platform.applications[0]; // To force Change Detection appRef.tick(); // To get a hold of spcefic component var settings: Probe = appRef.probe('app-cmp > settings'); var user: BindingSet = settings.binding('user'); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ // https://gist.github.com/mhevery/4b1bdb59a8c16f9cbe76 /////////////////////// /// WORK IN PROGRESS // /////////////////////// declare module ng { var platform: Platform; } interface Platform { applications: ApplicationRef[]; } interface ApplicationRef { tick(): void; /** * selector is a simple CSS selector combined with * concatinators which allows easy traversal of the * View tree. * * NOTE: this selects over logical components not over * (some CSS langugae which would be easy to implement * and allows us to walk the tree) * * concatinators * - ' ' (space) recursive content/view descendant * - `>` direct content/view descendant * - `:view` direct view * * # examples * * `app-comp calendar:view` * */ probe(selector: string): Probe; } interface Probe { binding(selector: string): BindingSet; } interface BindingSet { value: any[]; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ # Constraints [latest gist](https://gist.github.com/mhevery/4b1bdb59a8c16f9cbe76) ## WebWorkers The API must be on the web-worker side, and must not depend on DOM. It is not even clear if there even is a DOM, in the case of Native UI. ## Shadow DOM & Selectors Shadow DOM and selectors are tricky since they can not be used with `querySelector`. (It does not pierce shadow DOM boundries) For this reason it is better not to rely on the `querySelector` at all and have a query mechanism of a tree. A custom query mechanism would be compatible with Native UI / WebWorkers. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ -
mhevery revised this gist
Dec 19, 2015 . 2 changed files with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,7 @@ declare interface Window { ng: Angular } interface Angular { } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ var appRef = ng. -
mhevery created this gist
Dec 19, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ declare interface Window { ng: }