According to their tutorial:
All location properties can be either a Supersonic routes or URLs.
When I use this in structure.coffee, nothing is loaded, only the initial splash screen is shown:
rootView:
location: "http://example.com/page1"
What else should I set?
It looks like this is a current issue on GitHub.
From that post:
A workaround is to run a local clone of Steroids and change
https://github.com/AppGyver/steroids/blob/master/src/steroids/features.coffee#L6
to be false, after which you can write
splashscreen:
autohide: true
in your config/app.coffee.
Related
This is a project I did some months ago in React.js, hosted on Github pages. I visited today, and the click listener I have on the infowindow is broken. The error I get is: read property 'addEventListener' of null, which means React thinks my selector is not added to the DOM.
This is the live version:
https://stamatisdeli.github.io/Neighborhood-map/
this is my repo:
https://github.com/StamatisDeli/Neighborhood-map/blob/master/src/App.js
in line 118 I call openModal
More errors occur when I click in a list item, but first things first.
Thanks!
You should probably move the offending code inside the domready event of the infowindow so you are sure its contents are available.
so change the
self.openModal()
line to
google.maps.event.addListener(infowindow, 'domready', function() {
self.openModal()
});
I am using Angular ngToast. I am trying to show only one toast at a time. The previously displayed toast should be hidden before displaying a new toast.There should be only one toast at a time. I tried be specifying maxNumber but doesn't work.
ngToast.create({
className: 'info',
content: ' New Toast',
maxNumber: 1
//autoDismiss: true,
//maxOpened: 1
//timeout: 500,
//preventDuplicates: true,
//preventOpenDuplicates: true
//dismissOnClick:true
//clickToClose: true
});
Here is a fiddle that might help you: https://jsfiddle.net/774a9dq4/5/
The only difference here is that before calling the new instance of toast object, just call the dismiss() which will be dismissing ALL the toast instances in DOM.
ngToast.dismiss();
ngToast.create({
content:'I am unique <3'
});
Hope this may help:
Use the ngToast.dismiss() to clear all toasts.
Or
ngToast.dismiss(yourToastMsg) to clear a particular toast.
For more details refer to this link.
The above answers are the easy quick one,but if you wan to take total control of your toastr config you need to take the below approach.
Why maxNumber:1 did not work is because this is available at only configuration level, So if you want to override those values you need to inject the config file while bootstrapping your application and override the maxNumber property.As described in the reference the * marked properties are at configuration level,rest others you can override on individual toast. ngToast
Something like this would work for you inject config to ngToast
app.config(['ngToastProvider', function(ngToastProvider) {
ngToastProvider.configure({
additionalClasses: 'my-animation'
});
}]);
app.directive('myDirective',function() {
return {
restrict : 'A',
templateUrl : 'app/html.html'
};
});
I'm running into a problem with template html getting cached in the internet explorer. Every time the html is changed, either one of these need to be done to load the new templete:
Delete browsing history and clear temporary internet files.
Change browser setting 'Check for newer versions of stored pages' from Automatic to 'Every time I visit'
A similar problem is stated Here. The marked answer works, but was thinking if there is any better solution to the problem rather than defeating the browser caching.
You must use app version and increase after each update:
<html data-ver="1.0">
And in your js code:
// for example: read app version from data-ver attribute on html tag
window.appVersion = angular.element(document.getElementsByTagName('html')).attr('data-ver');
app.directive('myDirective',function() {
return {
restrict : 'A',
templateUrl : 'app/html.html?v=' + window.appVersion
};
});
I had this issue with changes that I made to my templates. I was able get rid of the single template file that I needed to by following these steps:
Open Internet Explorer
Click the Tools (Alt-X) button and then click Internet Options
Click the General tab, and then under Browsing history, slick Settings
In the Temporary Internet Files and History Settings dialog box, click View Files
Locate the template file that you have modified and delete it.
I hope this helps.
If I am serving my Backbone application from http://example.com/foo/bar.html, what should I specify the application root as? E.g.:
Backbone.history.start({
pushState: true,
root: '/foo/'
});
vs
Backbone.history.start({
pushState: true,
root: '/foo/bar.html'
});
In fact, does it even matter as far as Backbone routing and history are concerned?
I notice that if I use the former form, images with relative URLs become broken because pushState would cause the (apparent) location of the window to change to a string like /foo/login, and then a relative URL like img/orange_cat.jpg gets resolved to /foo/login/img/orange_cat.jpg by the browser, when I really want /foo/img/orange_cat.jpg.
The first form is the correct one.
To fix the broken images issue
And add this to your head tag
<base href="/foo/" />
let's say that I have two "pages" (endpoints) on a chaplin.js site
the routes:
match('', 'first_controller#show');
match('second_view', 'second_controller#show');
and two links:
Go to home
Go to Second
the generated urls are "correct":
mysite.com/something/ (home)
mysite.com/something/second_view (second view)
(notice that I'm not on the root of the site). When I start the application at "home" and then click the "Go to second" link i get correctly redirected to the second view, everything gets tendered correctly and the url on the browser changes to mysite.com/something/second_view
But then I cannot refresh the navigator since my webserver will try to reach a second_view folder instead, and I'll get a 404.
What i need is to always generate the urls using a # like in backbone, something like mysite.com/something/#/second_view.
BTW: that last link works but chaplin deletes the # (like a redirect)
Maybe I need to configure something? or change something on the ùrl`helper, I couldn't find anything in the docs. Any Ideas??
Thxs
Backbone itself allows this functionality out of the box, through
Backbone.history.start({pushState: false})
(the default)
You can see the startHistory call here.
You just have to pass this options object as a second parameter to initRouter in your Application :
this.initRouter(routes, {pushState: false});