In my app, I have an image which when clicked make the transition to the different.This is working smoothly and the transition is always successful.But the problem I am facing is the transition takes around some time to render so that it could make different api call.During this time the app goes still and I am not able to tell the transition in happening.It should so something like loading sign in a tab like every web app does.I have tried both ways.
1) this.transitionToRoute('usrprofile',photo.get('owner_pk'));
in actions
2) {{#link-to "usrprofile",photo.owner_pk"}}<img>{{/link-to}}
It might be a silly question.But I am not able to do it.
Related
I'm trying to implement expo-store-review, and want the popup asking for a star rating. Instead of getting a popup asking for a rating, it is just redirecting to the app store.
My component:
import * as StoreReview from 'expo-store-review';
componentDidMount() {
StoreReview.requestReview();
}
I've been searching for hours - hopefully some fresh eyes can spot the issue. Thanks!
UPDATE - I even tried putting in button with this code, but when I click the button it again just opens the app store, instead of asking for a review in-app
UPDATE 2
`console.log(StoreReview)
console.log(StoreReview.requestReview)`
returns an object and a function, meaning they are both defined.
So I've got my little beginning of an app loading data from json into a CardScrollView. Sometimes this takes a few seconds, so I need a loading screen. Normally I'd do this with the progress action bar or a progress bar spinning around. I found a question around this:
https://stackoverflow.com/questions/20237873/google-glass-gdk-progress-indicator
So far so good, however I can't determine how to construct a layout for my activity so I see the progress loading and then when data load is finished, the card scroll view. What I'm doing now is first I set the loading view in the onCreate:
setContentView(mLoadingView)
Then later once the loader is finished I call:
mCardScrollView.activate()
setContentView(mCardScrollView)
Not only does this feel hackish, but it doesn't handle the case of reloading data. Normally I'd do this in android with a frame layout xml which would have the progress bar and list view in it and then toggle progress bar visibility / progress. But I'm not sure how to do this in glass. Maybe I'm not even following the right "glass paradigm". Any ideas?
Currently in the GDK sneak peek, you'll have to roll your own solution like you've already done. But you can track the feature request for a Glass-style progress here here on our issue tracker.
I am trying to build out edit functionality for a Goal record. On the Goal index page, there is an edit button next to each goal. When clicked, each field becomes editable. Upon clicking Save, the changes are saved to the server. So far so good.
There is also a Cancel button. When a user clicks it, I need to reset the state of the model to what it was before they changed things. goal.rollback() in the controller works fine for this. Except, if the user has already clicked Save but there were server side validation failures. In this case, attempting to rollback() throws Uncaught Error: Attempted to handle event `reloadRecord` on <App.Goal:ember123:1234> while in state root.loaded.updated.invalid.
If instead I try to goal.reloadRecord I get Uncaught Error: Attempted to handle event `reloadRecord` on <App.Goal:ember123:1234> while in state root.loaded.updated.invalid.
Same deal with goal.unloadRecord. I have tried massaging the state like this:
state = goal.get('currentState') #this code makes me sad.
state.isValid = true
state.isError = false
And like this:
goal.transitionTo('loaded.saved')
To no avail. Is make zero sense to me the reloading or unloading a record should be statefull.
Any assistance would be greatly appreciated. Again, I'm trying to take a dirty, invalid record in ember and get it back to a happy state either by rolling back changes, or just reloading it from the server.
EDIT: Ember-data v1.0.0-beta.3-4-g169793e, ember Version: 1.1.2
Here's a working example, change the color then hit save.
http://emberjs.jsbin.com/OxIDiVU/44/edit
PR submitted https://github.com/emberjs/data/pull/1590
I use Ember data with the REST Adapter. I want to make sure that in case of slow server responses, the application does not fail.
I have simulated this bij adding at server side a sleep method of 5 seconds before returning the JSON response.
If you have a form with a SAVE button, and you click this button while a previous save is still is progress, you receive a inFlight error and the whole Ember app freezes (only thing you can do is reload app). So, you can easily disable the save button by checking the isSaving state:
<button {{action 'save'}} {{bindAttr disabled="isSaving"}}>Save</button>
Now it also seems that when changing a form field while a previous save is still is progress, you receive a inFlight error. This would thus indicate that I also need to disable the complete form.
Uncaught Error: Attempted to handle event `willSetProperty` on
<App.Author:ember477:5203e34599808d1c6c000001> while in state
rootState.loaded.updated.inFlight. Called with {reference: [object Object], store:
<App.Store:ember541>, name: name}
Is there a known good practice to handle these cases ... I want to prevent that I need to add a lot of logic (disable buttons, set fields readonly, etc.) for these edge cases.
It may not be within the scope of what you are trying to do, but the Ember Persistence Foundation is designed to allow updating your models while a save is still in flight.
It is relatively trivial to migrate your models to EPF, but there are some changes required in the controller code, see "Migrating from Ember Data".
The new ember router has been throwing me for a loop. Does anyone know how to manually triggering a url change when you are (1) NOT using a redirect in the router (2) NOT using the linkTo helper?
It seems that this:
App.container.lookup('router:main').router
no longer works, as of today's build.
This seems hard to do in new ember router because ember is working hard to prevent you writing code in this style. Rather than access an instance of the router (or anything else) via App your ember application code should be working with properties that have been injected at runtime by the framework. As #sly7_7 mentioned above, your view will have access to the controller and controller can trigger a transition like:
view.get('controller').transitionTo('state')
Depending on how your third party library is working, you might do this by triggering an event in the dom (handled by the view) or by registering a callback when the view is rendered from within didInsertElement
The main thing to remember is that App.anything-in-lowercase is generally bad practice. Whenever possible try to let the framework take care of instantiating and wiring together your application classes.
For more detail, see the notes on this commit: https://github.com/emberjs/ember.js/commit/5becdc4467573f80a5c5dbb51d97c6b9239714a8
You can try this:
App.__container__.lookup('router:main').transitionTo('name_of_your_route');