-
Notifications
You must be signed in to change notification settings - Fork 15
Usage
Previous: Installation | Next: Options
As this is an Ember addon it will run on your build tree automatically. However, you will have to make a couple of changes to your index.html
files to avoid requesting non-existent files in the browser.
Please note, if you are using an Ember CLI version less than 1.4.0 an additional setup step is required.
Remove the following <link>
and <script>
tags from your index.html
files - don't worry this addon will request the assets on the fly.
<!-- app/index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>App Name</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for 'head'}}
<!-- Removed -->
<!-- <link rel="stylesheet" href="assets/vendor.css"> -->
<!-- <link rel="stylesheet" href="assets/app-name.css"> -->
{{content-for 'head-footer'}}
</head>
<body>
{{content-for 'body'}}
<!-- Removed -->
<!-- <script src="assets/vendor.js"></script> -->
<!-- <script src="assets/app-name.js"></script> -->
{{content-for 'body-footer'}}
</body>
</html>
And in your tests' dummy app:
<!-- tests/dummy/app/index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>App Name</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{content-for 'head'}}
{{content-for 'test-head'}}
<!-- Removed -->
<!-- <link rel="stylesheet" href="assets/vendor.css"> -->
<!-- <link rel="stylesheet" href="assets/app-name.css"> -->
<!-- <link rel="stylesheet" href="assets/test-support.css"> -->
<style>
#ember-testing-container {
position: absolute;
background: white;
bottom: 0;
right: 0;
width: 640px;
height: 384px;
overflow: auto;
z-index: 9999;
border: 1px solid #ccc;
}
#ember-testing {
zoom: 50%;
}
</style>
{{content-for 'head-footer'}}
{{content-for 'test-head-footer'}}
</head>
<body>
{{content-for 'body'}}
{{content-for 'test-body'}}
<!-- Removed -->
<!-- <script src="assets/vendor.js"></script> -->
<!-- <script src="assets/test-support.js"></script> -->
<!-- <script src="assets/app-name.js"></script> -->
<script src="testem.js"></script>
<script src="assets/test-loader.js"></script>
{{content-for 'body-footer'}}
{{content-for 'test-body-footer'}}
</body>
</html>
As previously stated, if you are using a version of Ember CLI less than 1.4.0 you will need to define the stylesContentFor
option as follows:
// Brocfile.js
var app = new EmberApp({
emberCliConcat: {
stylesContentFor: 'head'
}
});
This is because the head-footer
and body-footer
types of {{content-for}}
weren't introduced until Ember CLI 1.4.0.
Previous: Installation | Next: Options