TimmyBeef's Blog

life & learning notes

Angular - @ViewChild && ngAfterViewInit

若想要直接取得目前 child componet 的值 (不是做 content projection) 那就要使用 @ViewChild 想要取得 <auth-message> child componet 的值的話 123456789101112131415161718<div> <form (ngSubmit)="onSubmit(form.valu......

@ContentChildren && QueryList

@ContentChildren 能取得多個 child content (由 ng-content 投射的內容) 12345678910111213141516171819202122232425<!--app.component.ts-->@Component({ selector: 'app-root', template: ` <div>......

@ContentChild && ngAfterContentInit

承接上一篇 ng-content 的用法 現在我們希望在勾選 checkbox 時會顯示訊息, 也就是取得 child content 的 checkbox 值, 塞到 showMessage, 來顯示這段文字 123<!--當 showMessage 為 true 時顯示 You will be logged in for 30 days--><div *ngIf="......

Angular - ng-content 的用法

畫面需要重複利用的內容時,可利用嵌入內容設計 (transclusion) 來達成,是一個內容投射 (content projection) 的概念 Content projection with ng-content (投射全部內容) 如下圖所示,在 app-root 畫面,使用了兩個 auth-form的元件內容,但auth-form的 title 因為寫死了,所以現在畫面都長一樣,......

舊專案必學技術整理 - Java coding style & 前後端 DEBUG

Java coding style 注意事項 123private String fyr = StringUtils.EMPTY; // v.s. //private String fyr = ""; // better 12345if (!StringUtils.equals("G3", toPos)) {...} // v.s. //if ......

舊專案必學技術整理 - Spring MVC & Spring Data

後端程式說明 專案結構說明 brt-entity 下 放 ept entity, 其他都是吃 m2 下的 jar 檔的 entity brt-netterm-applet 下 netterm 相關程式 brt-webapp 下 package gov.nta.brt.web.dto; 會使用到的 dto 物件 package gov.nta.brt.web.rest; rest ......

舊專案必學技術整理 - 開發環境設定 & 前後端溝通(RESTful API)

開發環境設置 本案開發工具: cultivator-20140508-1145-x86_64 (based on Eclipse) jboss-eap-6.1 maven 是什麼? maven 透過 pom.xml 來定義和管理 java jar lib nexus server 取得 jar 的 repository server JBoss 本案中執行 war 的 ap ......

舊專案必學技術整理 - AngularJS

AngularJS 必會語法解說 Two-way Data Binding 在 AngularJS 裡,所有在 View 與 Controller 之間,都是透過 Model 來做資料傳遞, 無論你在 View 這端透過表單元素修改了內容,或是在 Controller 這端修改了 Model 內容, 兩邊都會即時發生變化,因為在 AngularJS 框架中會監控 (watch) Model ......

舊專案必學技術整理 - JavaScript 基礎概念

JavaScript 基礎概念 變數 都使用 var (JS ES6 後有像是 let, const 等其他關鍵字, 但本案相關開發請都用 var) 資料型態 主要的原始資料類型: 數字(Number) 字串(String) 布林(Boolean) 特殊的原始資料類型: 空(null) 未定義(undefined) 符號(Symbol) 複合型(composite)或參考型(r......

舊專案必學技術整理 - Bootstrap

因為又要為之前的客戶做教育訓練…所以整理了一些之前專案用的技術,必學的部分,比較進階的就不教了XD Bootstrap 3 RWD - 響應式網頁設計(Responsive Web Design) 優點: 適應不同螢幕尺寸 開發維護成本低 分享網址好用 GOOGLE 愛用 不用到 APP 商店下載 缺點: 須注意載入時間(因為圖片需要手機版一張, 網頁版一張), 可利用工具檢測 瀏......