File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -209,22 +209,16 @@ Requests for `user-profile` would now target `/user_profile/1`.
209
209
Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary
210
210
headers can be set as key/value pairs on the ` JSONAPIAdapter ` 's ` headers `
211
211
object and Ember Data will send them along with each ajax request.
212
- (Note that we set headers in ` constructor() ` because default property values
213
- should not be arrays or objects.)
214
212
215
213
``` javascript {data-filename=app/adapters/application.js}
216
214
import DS from ' ember-data' ;
217
215
const { JSONAPIAdapter } = DS ;
218
216
219
217
export default class ApplicationAdapter extends JSONAPIAdapter {
220
- constructor () {
221
- super (... arguments );
222
-
223
- this .headers = {
224
- ' API_KEY' : ' secret key' ,
225
- ' ANOTHER_HEADER' : ' Some header value'
226
- };
227
- }
218
+ headers = {
219
+ ' API_KEY' : ' secret key' ,
220
+ ' ANOTHER_HEADER' : ' Some header value'
221
+ };
228
222
}
229
223
```
230
224
You can’t perform that action at this time.
0 commit comments