Laravel 5 – global Blade view variable available in all templates

Option 1: You can use view::share() like so: <?php namespace App\Http\Controllers; use View; //You can create a BaseController: class BaseController extends Controller { public $variable1 = “I am Data”; public function __construct() { $variable2 = “I am Data 2”; View::share ( ‘variable1’, $this->variable1 ); View::share ( ‘variable2’, $variable2 ); View::share ( ‘variable3’, ‘I am Data … Read more

How to realize website with hundreds of pages in Angular2

All following solutions are tricky. Official Angular team support issue is here. Thanks to @EricMartinez for pointing me to @alexpods solution: this.laoder.loadIntoLocation( toComponent(template, directives), this.elementRef, ‘container’ ); function toComponent(template, directives = []) { @Component({ selector: ‘fake-component’ }) @View({ template, directives }) class FakeComponent {} return FakeComponent; } And another similar (from @jpleclerc): @RouteConfig([ new AsyncRoute({ … Read more