text: webpackJsonp([1],{NHnr:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=i("7+uW"),r={render:function(){var t=this.$createElement,e=this._self._c||t;return e("nav",[e("div",{staticClass:"nav-wrapper green"},[e("div",{staticClass:"container"},[e("router-link",{staticClass:"brand-logo",attrs:{to:"/"}},[this._v("\n        Articles Dashboard\n      ")])],1)])])},staticRenderFns:[]},l={name:"App",components:{Navbar:i("VU/8")(null,r,!1,null,null,null).exports}},n={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[e("Navbar"),this._v(" "),e("div",{staticClass:"container"},[e("router-view")],1)],1)},staticRenderFns:[]},s=i("VU/8")(l,n,!1,null,null,null).exports,c=i("/ocq"),o=i("kxiW"),d=i.n(o),u=(i("881v"),d.a.initializeApp({apiKey:"AIzaSyB1cAl97hjFEdbiADLsYrG2zhjxmyw2dEY",authDomain:"vue-prod-e32d2.firebaseapp.com",databaseURL:"https://vue-prod-e32d2.firebaseio.com",projectId:"vue-prod-e32d2",storageBucket:"vue-prod-e32d2.appspot.com",messagingSenderId:"297453523647"}),d.a.firestore());u.settings({timestampsInSnapshots:!0});var v=u,p={name:"dashboard",data:function(){return{articles:[]}},created:function(){var t=this;v.collection("articles").orderBy("article_id").get().then(function(e){e.forEach(function(e){console.log(e.data());var i={id:e.id,article_id:e.data().article_id,title:e.data().title,body:e.data().body};t.articles.push(i)})})}},_={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"dashboard"},[i("ul",{staticClass:"collection with-header"},[i("li",{staticClass:"collection-header"},[t._v("Articles")]),t._v(" "),t._l(t.articles,function(e){return i("li",{key:e.id,staticClass:"collection-item"},[i("div",{staticClass:"chip"},[t._v(t._s(e.article_id))]),t._v("\n      "+t._s(e.title)+"\n\n      "),i("router-link",{staticClass:"secondary-content",attrs:{to:{name:"view-article",params:{article_id:e.article_id}}}},[i("i",{staticClass:"fa fa-eye"})])],1)})],2),t._v(" "),i("div",{staticClass:"fixed-action-btn"},[i("router-link",{staticClass:"btn-floating btn-large red",attrs:{to:"/new"}},[i("i",{staticClass:"fa fa-plus"})])],1)])},staticRenderFns:[]},f=i("VU/8")(p,_,!1,null,null,null).exports,m={name:"new-article",data:function(){return{article_id:null,title:null,body:null}},methods:{saveArticel:function(){var t=this;v.collection("articles").add({article_id:this.article_id,title:this.title,body:this.body}).then(function(e){return t.$router.push("/")})}}},h={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"new-article"},[i("h3",[t._v("New Article")]),t._v(" "),i("div",{staticClass:"row"},[i("form",{staticClass:"cal s12",on:{submit:function(e){return e.preventDefault(),t.saveArticel(e)}}},[i("div",{staticClass:"row"},[i("div",{staticClass:"input-field col s12"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.article_id,expression:"article_id"}],attrs:{type:"text",required:""},domProps:{value:t.article_id},on:{input:function(e){e.target.composing||(t.article_id=e.target.value)}}}),t._v(" "),i("label",[t._v("Article ID#")])])]),t._v(" "),i("div",{staticClass:"row"},[i("div",{staticClass:"input-field col s12"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.title,expression:"title"}],attrs:{type:"text",required:""},domProps:{value:t.title},on:{input:function(e){e.target.composing||(t.title=e.target.value)}}}),t._v(" "),i("label",[t._v("Title")])])]),t._v(" "),i("div",{staticClass:"row"},[i("div",{staticClass:"input-field col s12"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.body,expression:"body"}],attrs:{type:"text",required:""},domProps:{value:t.body},on:{input:function(e){e.target.composing||(t.body=e.target.value)}}}),t._v(" "),i("label",[t._v("Body")])])]),t._v(" "),i("button",{staticClass:"btn",attrs:{type:"submit"}},[t._v("Submit")]),t._v(" "),i("router-link",{staticClass:"btn grey",attrs:{to:"/"}},[t._v("Back")])],1)])])},staticRenderFns:[]},b=i("VU/8")(m,h,!1,null,null,null).exports,y={name:"view-article",data:function(){return{article_id:null,title:null,body:null}},beforeRouteEnter:function(t,e,i){v.collection("articles").where("article_id","==",t.params.article_id).get().then(function(t){t.forEach(function(t){i(function(e){e.article_id=t.data().article_id,e.title=t.data().title,e.body=t.data().body})})})},watch:{$route:"fetchData"},methods:{fetchData:function(){var t=this;v.collection("articles").where("article_id","==",this.$route.params.article_id).get().then(function(e){e.forEach(function(e){t.article_id=e.data().article_id,t.title=e.data().title,t.body=e.data().body})})},deleteArticle:function(){var t=this;confirm("Are you sure?")&&v.collection("articles").where("article_id","==",this.$route.params.article_id).get().then(function(e){e.forEach(function(e){e.ref.delete(),t.$router.push("/")})})}}},C={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"view-article"},[i("ul",{staticClass:"collection with-header"},[i("li",{staticClass:"collection-header"},[i("h4",[t._v(t._s(t.article_id)+" "+t._s(t.title))])]),t._v(" "),i("li",{staticClass:"collection-item"},[t._v(t._s(t.body))])]),t._v(" "),i("router-link",{staticClass:"btn grey",attrs:{to:"/"}},[t._v("Back")]),t._v(" "),i("button",{staticClass:"btn red",on:{click:t.deleteArticle}},[t._v("Delete")]),t._v(" "),i("div",{staticClass:"fixed-action-btn"},[i("router-link",{staticClass:"btn-floating btn-large red",attrs:{to:{name:"edit-article",params:{article_id:t.article_id}}}},[i("i",{staticClass:"fa fa-pen"})])],1)],1)},staticRenderFns:[]},w=i("VU/8")(y,C,!1,null,null,null).exports,g={name:"edit-article",data:function(){return{article_id:null,title:null,body:null}},beforeRouteEnter:function(t,e,i){v.collection("articles").where("article_id","==",t.params.article_id).get().then(function(t){t.forEach(function(t){i(function(e){e.article_id=t.data().article_id,e.title=t.data().title,e.body=t.data().body})})})},watch:{$route:"fetchData"},methods:{fetchData:function(){var t=this;v.collection("articles").where("article_id","==",this.$route.params.article_id).get().then(function(e){e.forEach(function(e){t.article_id=e.data().article_id,t.title=e.data().title,t.body=e.data().body})})},updateArticel:function(){var t=this;v.collection("articles").where("article_id","==",this.$route.params.article_id).get().then(function(e){e.forEach(function(e){e.ref.update({article_id:t.article_id,title:t.title,body:t.body}).then(function(e){t.$router.push({name:"view-article",params:{article_id:t.article_id}})})})})}}},x={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"edit-article"},[i("h3",[t._v("Edit Article")]),t._v(" "),i("div",{staticClass:"row"},[i("form",{staticClass:"cal s12",on:{submit:function(e){return e.preventDefault(),t.updateArticel(e)}}},[i("div",{staticClass:"row"},[i("div",{staticClass:"input-field col s12"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.article_id,expression:"article_id"}],attrs:{type:"text",disabled:"",required:""},domProps:{value:t.article_id},on:{input:function(e){e.target.composing||(t.article_id=e.target.value)}}})])]),t._v(" "),i("div",{staticClass:"row"},[i("div",{staticClass:"input-field col s12"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.title,expression:"title"}],attrs:{type:"text",required:""},domProps:{value:t.title},on:{input:function(e){e.target.composing||(t.title=e.target.value)}}})])]),t._v(" "),i("div",{staticClass:"row"},[i("div",{staticClass:"input-field col s12"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.body,expression:"body"}],attrs:{type:"text",required:""},domProps:{value:t.body},on:{input:function(e){e.target.composing||(t.body=e.target.value)}}})])]),t._v(" "),i("button",{staticClass:"btn",attrs:{type:"submit"}},[t._v("Submit")]),t._v(" "),i("router-link",{staticClass:"btn grey",attrs:{to:"/"}},[t._v("Back")])],1)])])},staticRenderFns:[]},A=i("VU/8")(g,x,!1,null,null,null).exports;a.a.use(c.a);var E=new c.a({routes:[{path:"/",name:"dashboard",component:f},{path:"/new",name:"new-article",component:b},{path:"/edit/:article_id",name:"edit-article",component:A},{path:"/:article_id",name:"view-article",component:w}]});a.a.config.productionTip=!1,new a.a({el:".app",router:E,components:{App:s},template:"<App/>"})}},["NHnr"]);
  //# sourceMappingURL=app.4bf693ebd4b9aca05987.js.map