Closed giwrgos88 closed 7 years ago
Did you change the namespace to something other than the default window
? If that value is anything other than window, for example if you changed it to foobar
, you have to prefix any values you pass with what you changed it to. That doesn't need to be specified if the value is window as that is the global namespace in a browser.
but if you changed it to foobar
, then you'd have to get to your path value as foobar.path
I have did exactly what the README says to install the library on my laravel project.
So my composer has
Then on my app.php i have the following
'providers' => [Laracasts\Utilities\JavaScript\JavaScriptServiceProvider::class] 'aliases' => ['JavaScript'=> Laracasts\Utilities\JavaScript\JavaScriptFacade::class]
So in my class i added the javascript like this use JavaScript; and then I initialized it as follows \JavaScript::put([ 'path' => 'gi', ]);
but it keeps shown me "Uncaught ReferenceError: path is not defined"
Here is the way how i including the .js file from my blade template @section('scripts') < script src="{!! Module::asset('portfolio/portfolio.js') !!}"></ script> @stop
What I'm doing wrong?