Skip to content
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

SAUL_Exo03 #9

Open
wants to merge 8 commits into
base: master
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
1 change: 1 addition & 0 deletions cour01/Angular-Exo01/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions cour01/Angular-Exo01/css/my.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
p{
color: blue;
}
32 changes: 32 additions & 0 deletions cour01/Angular-Exo01/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="stylesheet" href="css/my.css" type="text/css">
<link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
</head>

<body>
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/popper.js/dist/umd/popper.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="node_modules/lodash/lodash.min.js"></script>
<script src="js/my.js"></script>


<p>Hello <span id="myFood">Pizza</span>!</p>

<button class="btn btn-outline-warning btn-lg" onclick="alertFood()">Change</button>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a onclick="showPrice('pasta')" class="dropdown-item" href="#">Pasta</a>
<a onclick="showPrice('pizza')" class="dropdown-item" href="#">Pizza</a>
<a onclick="showPrice('salade')" class="dropdown-item" href="#">Salade</a>
</div>
</div>
</body>
</html>
28 changes: 28 additions & 0 deletions cour01/Angular-Exo01/js/my.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var a = 0;
function alertFood() {
var food = [
"Pasta",
"Pizza",
"Salade"
];

alert(food[a]);

a++;
if (a == 3) {
a = 0;
}
}

var plats = [
{ 'plat': 'pasta', 'prix': 10 },
{ 'plat': 'pizza', 'prix': 12 },
{ 'plat': 'salade', 'prix': 8 }
];

function showPrice(food) {
$("#myFood").text(food);

var index = _.findIndex(plats, function(o) { return o.plat == food; });
alert(plats[index].prix);
}
18 changes: 18 additions & 0 deletions cour01/Angular-Exo01/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bootstrap": "^4.0.0",
"jquery": "^3.3.1",
"lodash": "^4.17.4",
"popper.js": "^1.12.9"
}
}
3 changes: 3 additions & 0 deletions cour02/Angular-Exo02/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory" : "bower_components"
}
10 changes: 10 additions & 0 deletions cour02/Angular-Exo02/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 2 additions & 0 deletions cour02/Angular-Exo02/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
bower_components
31 changes: 31 additions & 0 deletions cour02/Angular-Exo02/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
"eqnull": true,
"browser": true,
"smarttabs": true,
"globals": {
"jQuery": true,
"angular": true,
"console": true,
"$": true,
"_": true,
"moment": true,
"describe": true,
"beforeEach": true,
"module": true,
"inject": true,
"it": true,
"expect": true,
"xdescribe": true,
"xit": true,
"spyOn": true
}
}
6 changes: 6 additions & 0 deletions cour02/Angular-Exo02/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
temp/
dist/
node_modules/
_SpecRunner.html
.DS_Store
test-results.xml
23 changes: 23 additions & 0 deletions cour02/Angular-Exo02/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"generator-cg-angular": {
"uirouter": false,
"partialDirectory": "partial/",
"modalDirectory": "partial/",
"directiveDirectory": "directive/",
"filterDirectory": "filter/",
"serviceDirectory": "service/",
"inject": {
"js": {
"file": "index.html",
"marker": "<!-- Add New Component JS Above -->",
"template": "<script src=\"<%= filename %>\"></script>"
},
"less": {
"relativeToModule": true,
"file": "<%= module %>.less",
"marker": "/* Add Component LESS Above */",
"template": "@import \"<%= filename %>\";"
}
}
}
}
Loading