diff --git a/my-todolist/.gitignore b/my-todolist/.gitignore index debc15c..0bf4790 100644 --- a/my-todolist/.gitignore +++ b/my-todolist/.gitignore @@ -2,4 +2,5 @@ node_modules/ .idea -uploads + +uploads/ diff --git a/my-todolist/js/MainController.js b/my-todolist/js/MainController.js index b1d5d88..83fe6d6 100644 --- a/my-todolist/js/MainController.js +++ b/my-todolist/js/MainController.js @@ -3,16 +3,64 @@ */ function MainController($scope){ + this.likelist=[]; + this.myAmount=209.82; + this.myDate=1288323623006; + this.text="the text is here"; + this.myarray=[ + "angular","app" + ]; + this.addMovie=function(){ + this.favourites.unshift({ + title:this.newtitle, + year:this.release + } + ) + }; + this.unlike= function(index){ + this.likelist.splice(index,1); + }; + this.myObject={ + one:"key1", + two:"key2" + }; + this.addToLikes=function(movie) + { +// in function + this.likelist.push(movie); + }; this.favourites=[{ title:'the shawshank', year:'1994', popular:true },{ - title:'the shawshank', - year:'1994', + title:'excorcist', + year:'1995', popular:false }] } +function UserController($http){ +var API='/api/todo'; +this.userId=''; +this.chosenUser={}; +this.getUser=function(){ + if(!this.userId){ + return; + } + $http.get(API+this.userId); + $http.then(function(response){ + this.chosenUser=response.data; + console.log(this.chosenUser) + },function(reason){ +console.log(reason) + }); + $http.post() +} +} + + angular.module('app1') - .controller('MainController',MainController) \ No newline at end of file + .controller('MainController',MainController) +angular.module('app2') + .controller('UserController',UserController) \ No newline at end of file diff --git a/my-todolist/js/app.js b/my-todolist/js/app.js index b3c724f..a38e782 100644 --- a/my-todolist/js/app.js +++ b/my-todolist/js/app.js @@ -1,4 +1,5 @@ /** * Created by lcom64 on 30/1/17. */ -angular.module('app1',[]); \ No newline at end of file +angular.module('app1',[]); +angular.module('app2',[]); \ No newline at end of file diff --git a/my-todolist/js/app2.js b/my-todolist/js/app2.js new file mode 100644 index 0000000..e69de29 diff --git a/my-todolist/js/index1.html b/my-todolist/js/index1.html index 2e21e93..6a0c9f8 100644 --- a/my-todolist/js/index1.html +++ b/my-todolist/js/index1.html @@ -6,11 +6,60 @@ + + +
-
  • + +
    {{main.myObject|json}}
    + Year + Title +
    + {{like.title}} + Unlike +
    +
    {{ movies.title }} + Add like

    the movie is popular

    -
  • +
    +
    +
    + + + +
    +
    + + {{main.myDate| date:'EEEE'}}
    + {{main.myDate| date:'medium'}}
    + {{main.myDate| date:'short'}}
    + {{main.myDate| date:'longDate'}}
    + {{main.myDate| date:'MMMM'}}
    + {{main.myDate| date:'MM'}}
    + {{main.myDate| date:'yyyy'}}
    + {{main.myDate| date:'HH'}}
    + {{main.myDate| date:'EEEE'}}
    + {{main.myAmount|currency}} + {{main.myAmount|currency:'USD':1}} + + + {{ main.myarray.length>0? + "Something here": + "Nothing here" + }} + + + + {{main.myObject[Mykey]}} + diff --git a/my-todolist/js/index2.html b/my-todolist/js/index2.html new file mode 100644 index 0000000..bb96bc3 --- /dev/null +++ b/my-todolist/js/index2.html @@ -0,0 +1,19 @@ + + + + + Title + + +
    +
    + + + Search user +
    +
    {{user.chosenUser}}
    +
    + + + + \ No newline at end of file diff --git a/my-todolist/package.json b/my-todolist/package.json index 597b494..8bf1ca4 100644 --- a/my-todolist/package.json +++ b/my-todolist/package.json @@ -6,7 +6,7 @@ "cookie-session": "~1.1.0", "ejs": "~2.1.4", "express": "~4.11.0", - "mongoose": "4.7,7", + "mongoose": "4.7.7", "multer": "^1.2.1", "validator": "6.2.1", "path":"0.12.7", diff --git a/my-todolist/uploads/33cbf6c3f892f7725ea81c0598c9df5c b/my-todolist/uploads/33cbf6c3f892f7725ea81c0598c9df5c deleted file mode 100644 index 9cbad1f..0000000 Binary files a/my-todolist/uploads/33cbf6c3f892f7725ea81c0598c9df5c and /dev/null differ