Skip to content

Instantly share code, notes, and snippets.

@Serabe
Created October 13, 2017 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Serabe/f20d82ba73968ed3b81becea9001cf63 to your computer and use it in GitHub Desktop.
Save Serabe/f20d82ba73968ed3b81becea9001cf63 to your computer and use it in GitHub Desktop.
currentPath Vs. currentRouteName
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('root', function() {
this.route('reset', { resetNamespace: true });
});
});
export default Router;
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
a {
padding:5px;
border: 2px solid red;
margin: 20px;
}
.active {
border-color: green;
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
<ul>
<li>currenPath {{currentPath}}</li>
<li>currentRouteName {{currentRouteName}}</li>
</ul>
{{outlet}}
{{link-to 'index' 'index'}}
{{link-to 'root' 'root'}}
{{link-to 'reset' 'reset'}}
<br>
<br>
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment