기본 콘텐츠로 건너뛰기

Angular JS 1 사용해서 todo 만들기 (feat. Bootstrap)

Angular JS 1 사용해서 todo 만들기 (feat. Bootstrap)

< !DOCTYPE html >

< html >

< head >

< link data-require = "bootstrap@4.1.3" data-semver = "4.1.3" rel = "stylesheet" href = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" / >

< script data-require = "bootstrap@4.1.3" data-semver = "4.1.3" src = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" > < / script >

< script data-require = "angularjs@1.5.7" data-semver = "1.5.7" src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js" > < / script >

< link rel = "stylesheet" href = "style.css" / >

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

< / head >

< body ng-app = "todo" ng-controller = "TodoCtrl" >

< div class = "container" >

< h1 > todo list < / h1 >

< ul class = "list-unstyled" >

< li ng-repeat = "todo in todos | filter:statusFilter" >

< div class = "input-group mb-3" >

< div class = "input-group-prepend" >

< div class = "input-group-text" >

< input type = "checkbox" aria-label = "Checkbox for following text input" ng-model = "todo.completed" / >

< / div >

< / div >

< input type = "text" class = "form-control" aria-label = "Text input with checkbox" ng-model = "todo.title" / >

< div class = "input-group-append" >

< button class = "btn btn-danger" type = "button-" id = "button-addon2" ng-click = "remove(todo)" > 삭제 < / button >

< / div >

< / div >

< date > {{ todo.createdAt | date:'yyyy-MM-dd HH:mm:ss' }} < / date >

< / li >

< / ul >

< button class = "btn btn-primary" ng-click = "statusFilter={completed:true}" > Completed < / button >

< button class = "btn btn-primary" ng-click = "statusFilter={completed:false}" > Active < / button >

< button class = "btn btn-primary" ng-click = "statusFilter={}" > All < / button >

< / div >

< / body >

from http://javannspring.tistory.com/247 by ccl(A) rewrite - 2020-03-07 04:21:08

댓글

이 블로그의 인기 게시물

angular4 custom RouteReuseStrategy

angular4 custom RouteReuseStrategy import { RouteReuseStrategy, ActivatedRouteSnapshot, DetachedRouteHandle } from "@angular/router"; /* 호출 관계 테스트 1. /proc 열기 shouldReuseRoute. future: /, curr : / retrieve : / retrieve : / retrieve : /proc/ retrieve : /proc/ shouldAttach : / shouldAttach : /proc/ 2. /mem 이동 shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /proc/, curr : /mem/ retrieve : /mem/ retrieve : /mem/ shouldDetach : /proc/ store : /proc/ shouldAttach : /mem/ 3. /net 이동 shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /, curr : / shouldReuseRoute. future: /mem/, curr : /net/ retrieve : /net/ retrieve : /net/ shouldDetach : /mem/ store : /mem/ shouldAttach : /net/ 4. /mem 로 다시...

[Debugging] AngularJS2 - Can't bind to 'ngModel' since it isn't a...

[Debugging] AngularJS2 - Can't bind to 'ngModel' since it isn't a... - 좋아요 하이 .. !! Angular2 로 개발을 하다가 아래와 같은 에러를 만났다. 흠 .. 이게 뭘까 열심히 구글링을 해봤다. 간단한 내용이다. 모듈을 추가해주기만 하면 된다. app.module.ts를 열어보자. 여기에다가 FormsModule 과 ReactiveFormsModule을 추가해주면 문제가 해결된다 ! 다들 즐거운 코딩하자. from http://devkingdom.tistory.com/106 by ccl(A) rewrite - 2020-03-18 00:54:15