<p dir="auto">Browsersync not launching in beta.11</p>
<p dir="auto">package.json:<br>
...<br>
"scripts": {<br>
"postinstall": "npm run typings install",<br>
"tsc": "tsc",<br>
"tsc:w": "tsc -w",<br>
"lite": "lite-server",<br>
"start": "concurrent "npm run tsc:w" "npm run lite" ",<br>
"typings": "typings"<br>
},</p>
<p dir="auto">"dependencies": {<br>
"angular2": "^2.0.0-beta.11",<br>
"es6-promise": "^3.1.2",<br>
"es6-shim": "^0.35.0",<br>
"reflect-metadata": "^0.1.3",<br>
"rxjs": "^5.0.0-beta.2",<br>
"systemjs": "^0.19.23",<br>
"zone.js": "^0.6.2"<br>
},<br>
.....</p>
<p dir="auto">Environment:<br>
MAC/Chrome</p>
<p dir="auto">"Issue":<br>
When executing npm start, browsersyc does not appear to be starting. Changes are detected but not refreshed in browser.</p>
<p dir="auto">"Resolution:<br>
Changing entry in package.json from "angular2": "^2.0.0-beta.11" to ("angular2": "^2.0.0-beta.9" or "angular2": "^2.0.0-beta.8") browsersyc works as expected.</p>
<p dir="auto">Directives like {If, Foreach, For ... etc.) are often used in many templates. To simplify the process and in the spirit of writing less code and for the sake of maintainability, It might be a good idea to have a <code class="notranslate">pre_loader</code> API where the project can pass in the common directives in and on startup all templates are pre-injected with the common directives.</p>
<p dir="auto"><strong>Example:</strong><br>
import {pre_loader, If, For, Foreach} from 'angular2/angular2';<br>
pre_loader('directives', [IF, For, Foreach]);</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/template/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/template">@template</a>({<br>
url: 'templates/main.html',<br>
directives: [MyOwnDirective]<br>
})</p>
<p dir="auto">With the above approach, the directives passed into the template would be IF, For, Foreach &amp; MyOwnDirective.<br>
The catch is to have <code class="notranslate">pre_loader('directives', [IF, For, Foreach]);</code> executed before anything else.</p>
<p dir="auto">The <code class="notranslate">pre_loader()</code> function can also be used for configs other than directives.</p>