I've tested this in both v2.2.0-beta.3 and v1.13.13 of the default ember-cli application.
I am using a locked jquery version of 1.11.3 to fix the new "uncaught" error with the newest bower update of jquery.
When I go load the page the default template/application.hbs is rendered correctly with no errors. Ember Inspector sees that it's a loaded ember app with no errors either. However the chrome page is stuck in a loading state. Whenever I make a change to the application.hbs the app does not trigger livereload to reload the page.
How can I fix this? I've tried uninstalling node, bower, ember, clearing caches and nothing seems to work. (side note: the default app works on my home computer but not on my work computer).
Related
I created a new app using the ember-cli. It creates the project just fine. I updated the 'bower.json' file to use 2.0.0 for both Ember and Ember Data and installed them. The core of my application setup works how it should.
When I do 'ember serve', my application opens at localhost:4200 but is constantly showing the reload gif on the tab and the status bar at the bottom of the screen continues to show 'waiting for localhost...'. The 'Welcome To Ember' text shows. Any changes I make are not live reloaded in my browser, however, a hard reload shows the changes even when just trying to edit the application.hbs file. Any ideas as to what's going on?
Are you on windows? It sounds like this bug that is currently being worked on.
https://github.com/ember-cli/ember-cli/issues/5123
For me ember serve --lrp 9000 worked and fixed live-reload.
(I tried the other suggestion to use ember serve host 0.0.0.0 and it stopped the "loading" spinner, but live-reload still did not work.)
I have built an ember application which has two routes say route1 and route2.
I got the compiled files from dist folder. I put those files in a tomcat server.
When i try to access that file through index.html, it works fine. But how can i navigate to a route in that compiled application?
Normally in ember-cli development environment, we navigation to a route using server:port/route_name
How can i perform the same operation in index.html without using any hyperlinks for routes?
Edit:
Got the answer. Setting ENV.locationType = 'hash' solved the navigation problem. I was able to access the route using index.html#/route_name
But I am still stuck with how to integrate ember app into a non-ember app.
Got the answer.
Setting ENV.locationType = 'hash' solved the navigation problem. I was able to access the route using index.html#/route_name
Setting ENV.APP.rootElement = '#ember-testing' solved inserting ember app into non-ember app. Create a div with the rootElement ID and then ember will automatically place the app inside the div.
I developed my webapp using Ember CLI 0.1.15, with emberjs. 1.8.1
I built the app with this command: ember build --environment production , and then I made a WAR out of the files produced under the dist folder of my project, and then I drop the WAR on my tomcat's webapps folder.
So, when I open the app: http://mytomcat/myapp/ ... it went fine, I saw my login screen, I logged in, and navigate around in my app, everythings fine. I could also do the back/forward button, and ember handles the transition well.
But when I click the refresh button on my browser -- the address bar of the browser was showing http://mytomcat/myapp/inventory/ at that moment -- I got 404 reply, from the tomcat.
Then I figured out why it happened: the refresh button sends a request to the tomcat for the path /myapp/myinventory/ ... of course the path /myinventory does not exist on the server. All those routes we see on the browser -- except for the base url, http://mytomcat/myapp/ -- are generated on the client-side.
So, my question is: what's the right way (in ember) to deal with this situation? I need the refresh button to just works. Any way for ember to intercept the refresh button clicked event?
I guess this issues is related to this: https://github.com/stefanpenner/ember-app-kit/issues/486 , but it does not have the answer I need.
Thanks in advance,
Raka
--- UPDATE ---
Probably relevant: http://eviltrout.com/2014/04/10/the-refresh-test.html
Inside config/environment.js file, there is a property called locationType. Set its value to hash
Manually moving files from your /dist folder is time consuming and annoying. Instead, you can specify an output-path property in your .ember-cli with the location inside webapps you are trying to move the files to. Another option is to specify this option to ember server or ember build
I am creating an app using Ember.js. I downloaded the Inspector for Firefox and Chrome and most of it seems to work fine, however, if I go to the data tab of the inspector, I just have a blank screen with no access to any of the data loaded.
I am using the DS.RESTAdapter and my application is pulling the data correctly and displaying it, it just doesn't show up in the add-on. Am I missing something? I would show some code examples but I am not even sure what to show.
What is the best approach to use EAK and ember-data-tastypie-adapter?
I am currently trying the following:
Django running on localhost:7000
EAK running on localhost:8000
Added ember-data-tastypie-adapter to bower.json
Added both JS files to index.html
<script src="/vendor/ember-data-tastypie-adapter/packages/ember-data-tastypie-adapter/lib/tastypie_adapter.js"></script>
<script src="/vendor/ember-data-tastypie-adapter/packages/ember-data-tastypie-adapter/lib/tastypie_serializer.js"></script>
Created everything needed on Django side
I figured that I had to create serializers/application.js and put in it:
export default DS.DjangoTastypieSerializer.extend();
Also adapters/application.js needed adjustments:
export default DS.DjangoTastypieAdapter.extend({
serverDomain: 'http://localhost:7000',
});
Requests go to Django and responses are sent.
However in EAK this gives "Sorry, something went wrong" message without any further information (empty error message box). No errors in console either.
If I remove serializers/application.js I get similar message, in this case with information about the error:
Assertion Failed: Nested controllers need be referenced as [/django/tastypie],
instead of [_djangoTastypie].
Refer documentation: http://iamstef.net/ember-app-kit/guides/naming-conventions.html
Do I have to define defaultSerializer in adapters/application.js? If so, what is it, /django/tastypie or something else?
What am I missing to integrate ember-data-tastypie-adapter in EAK? Trouble is, I have not seen any example where EAK and tastypie would be working together.
Of course this two local server system is development environment. Production is planned like here, both API and JS is served by one Django instance.
UPDATE:
Creating deployment code by grunt dist and serving it using Django works.
I suspect that problem lies with different JSON origin.
Turns out, that EAK has API proxy option.
Updated package.json to my API settings:
"proxyURL": "http://localhost:7000",
"proxyPath": "/api/v1",
Removed custom settings from adapters/application.js.
Now running grunt server:proxy gets data from Django. And ember.js app works without errors, not being same origin was most likely the problem.