ember.js

Ember Simple Auth (with token plugin) won't add the Authorization header with the token

牧云@^-^@ 提交于 2019-12-13 18:18:10
问题 I had a simple and working application with Ember CLI 0.1.12. I use the Ember Simple Auth addon with the Token authenticator and authorizer. https://github.com/jpadilla/ember-cli-simple-auth-token First, I wasn't able to authenticate, because I had no idea what the server was supposed to return. After a lot of googling, I was able to figure out that the server should return something like this: { "access_token": "ToKeN123hEre" } Now I was able to authenticate and sessions work. But when I

Ember: route ID is lost after a transition.retry() - Am I doing something wrong?

微笑、不失礼 提交于 2019-12-13 17:57:59
问题 See JSFiddle: http://jsfiddle.net/cyclomarc/MHvrH/3/ There are a lot of samples that show how to implement authentication in Ember. To protect access to a route, you will be redirected to a login page if you do not have a valid token. After succesful login (thus after obtaining a valid token), you will be redirected to the initial requested page. Implementation: before the redirect to login, you store the requested transition in an object; after login, you read the object property and do a

Remember me with OAuth2 in SPA

谁说胖子不能爱 提交于 2019-12-13 17:27:16
问题 I know the concept of OAuth2 and OpenID. in our application authentication is happening through OKTA and we receive access-token in a response. Our architecture is a microservice-architecture and we are using EmberJS at frontend. we have to implement remember-me functionality it will keep the user logged in for the next 30 days. I did some study on it and came to points that will satisfy my requirements. keep user session active for 30 days in OKTA. refresh access token periodically based on

How to implement Ember-Validations in Ember-App-Kit(EAK)

♀尐吖头ヾ 提交于 2019-12-13 17:24:57
问题 I have a ember-app-kit application. For the form I am using ember default views. But for form validations I have came across with this lib which everyone highly recommends. Ember Validations By Docyard . But I am not sure how to implement the same with my eak set-up. Questions that I have: 1. Where should I add validations ? 2. What to declare when defining validations? 3. Errors how to show them on focus out or even on submit button ? Say for example I have a sign up form and I want to

Changing mouse cursor while Ember content is saving

谁都会走 提交于 2019-12-13 16:34:55
问题 I know Ember makes it quite straight forward to display an indicator on route transitions that take a long time. But what's the easiest way to do the same after a Save button is clicked, and until the save operation completes? I am not finding much on this. 回答1: Assuming based off the tag you are using ember data $('html,body').css('cursor','crosshair'); record.save().finally(function(){ // revert mouse }); http://emberjs.com/api/classes/Ember.RSVP.Promise.html#method_finally Obviously this

EmberJS pre2 put handlebar templates on wrong place

折月煮酒 提交于 2019-12-13 16:16:16
问题 I've try to update EmberJS from pre1 to pre2 on my web-app but I notice it put all handlebar templates as the last body elements, and sometime not at all. I've create a repro with the starter-kit with simple modification of putting div before and after the template to show the template will be added in the wrong place. Run this same page with pre1 and it all works just fine. index.html .... <body> <div>this is before the template</div> <script type="text/x-handlebars" data-template-name=

How to pass model in Nested routes - emberjs

﹥>﹥吖頭↗ 提交于 2019-12-13 16:00:40
问题 I have some nested routes. App.Router.map(function() { this.route("dashboard", { path: "/dashboard" }); this.resource("customers", { path: "/customers" },function(){ this.resource("customer",{ path: "/:customer_id" },function(){ this.resource("customer.contact",{path:'/contact'}); }); }); }); TEMPLATES customers/index <script type="text/x-handlebars" data-template-name="customers/index"> <h3>Customers</h3> <table> {{#each item in model}} <tr> <td>{{item.name}}</td> {{#link-to "customer" item

Dynamically determine existence of Ember component?

六月ゝ 毕业季﹏ 提交于 2019-12-13 15:54:42
问题 I was looking through the ember-htmlbars package and discovered this util for determining if a component is available? https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/lib/utils/is-component.js Is there any way to use this from my app? I'm building a dashboard-type interface and some of the dashboard widgets have optional actions. In essence I'd like to do something like: <div class="panel panel-default"> <div class="panel-body"> {{component model.displayComponent model

Ember CLI fails in production

…衆ロ難τιáo~ 提交于 2019-12-13 15:46:53
问题 I am deploying an Ember CLI app through jenkins and publishing it using nginx. Here is by jenkins build script: npm install bower install node_modules/ember-cli/bin/ember build --environment=production The nginx configuration simply directs sub.domain.com to jenkins\jobs\lastStable\archive\dist . That works fine, but when I go the page, it is blank and the following output in the console: TypeError: Ember.Handlebars.compile is not a function vendor-92ab6507ac60a5bf7c6819aa8fc418d6.js:18

Set Env variables based on grunt task

喜你入骨 提交于 2019-12-13 15:18:53
问题 I have a webapp (emberjs) that I need to set env variables based on grunt task. So when I run grunt server it would choose development , and url will be set to localhost:5000 . But when i do grunt build , it would choose production and url will be set to production.com . The main issue for me is, how to read those variables from ember. Or how to make grunt look for a variable and change it based on the task Is it possible to do something like that? 回答1: After much googling and no good