What is the significance of index.html in Aurelia?

 Posted by Rajnilari2015 on 8/24/2016 | Category: JavaScript Interview questions | Views: 2009 | Points: 40
Answer:

index.html is deafult page of the app like in most of the HTML based apps. It is a place where scripts and stylesheets are loaded.

It looks as under

<!DOCTYPE html>

<html>
<head>
<title>Aurelia</title>
</head>
<body aurelia-app="src/main">
<script src="scripts/system.js"></script>
<script src="scripts/config-typescript.js"></script>
<script src="scripts/aurelia-core.min.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>


We can also configure the programming language selection.

Let's adjust our programming language. The default is pointing to TypeScript.

<script src="scripts/config-typescript.js"></script>

However, we will choose ESNext. So we need to change that to

<script src="scripts/config-esnext.js"></script>

So our index.html will now look like

<!DOCTYPE html>

<html>
<head>
<title>Aurelia</title>
</head>
<body aurelia-app="src/main">
<script src="scripts/system.js"></script>
<script src="scripts/config-esnext.js"></script>
<script src="scripts/aurelia-core.min.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response