Skip to content

Using project files #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function startGame() {
// starting new game
var messagesElement = document.getElementById('messages');
// reference to the messages div inside the index.html file //
messagesElement.innerText = 'Welcome to MultiMat! Starting a new game... ';
// Assigns a string to it's innerText property so that it will appear on the screen //
}
document.getElementById('startGame').addEventListener('click', startGame);
// calls start game function when the start game button is clikced in the app //


// BEFORE WE CAN USE THIS NEW JS FILE IN THE APP WE NEED TO ADD A REFERENCE TO IT IN THE INDEX.HTML FILE //
10 changes: 10 additions & 0 deletions app/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function startGame() {
// starting new game
var messagesElement = document.getElementById('messages');
// reference to the messages div inside the index.html file //
messagesElement.innerText = 'Welcome to MultiMat! Starting a new game... ';
// Assigns a string to it's innerText property so that it will appear on the screen //
}

document.getElementById('startGame').addEventListener('click', startGame);
// calls start game function when the start game button is clikced in the app //
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h4>No scores yet</h4>
<div class="col-sm-offset-2 col-sm-10" id="messages"></div>

<!-- add script tags here -->

<script src="/app/app.js"></script>

</body>
</html>
6 changes: 6 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// TYPESCRIPT PROJECT FILES //

- Simple Json text file names tsconfig.json
- Stores compiler options used with the project
- specifies the files thats should be included or excluded in compilation
- Support configuration inheriteance - In a large project you can create a project file at the root of ur project that includes all of the default options you want to apply to the project. You can then create additional project files in difference folders inside the project that can selectively override or add to the option specified in the root projectf file