星期日, 8月 31, 2014

[AngularJS] NVD3基於D3繪圖的directive module

An AngularJS directive for NVD3 re-usable charting library (based on D3).
Easily customize your charts via JSON API.

NVD3讓你可以透過directive來實現D3的繪圖效果: D,使用Angular需要圖表呈現可以考慮

星期四, 8月 28, 2014

星期一, 8月 25, 2014

[WordPress] 改wordpress的相關手法筆記












WooCommerce->設定->Tab商品->Shop Page Display->改為顯示子類別

[AngularJS] ngprogress-lite 網頁讀取進度條



[AngularJS] 實作簡單的multipart uplaod

Please note that solutions that use FormData(), such as the ones presented here in other answers, do not work correctly in older IE browsers.

The correct solution should use a backup strategy for that, such as using iFrames. There are already many angular JS modules to perform file uploading:


星期日, 8月 17, 2014

[Alfresco] 上傳大檔的相關問題筆記

  1. Heap Size issue (Need to increase that) 
  2. JVM memory allocation 
  3. session time out (It will take more time to write the data on created content so need to make sure session timeout does not happens)

[jQuery plugin] 使用同一個驗證規則來驗證多個textobx欄位

今天有個畫面需求,需用驗證多個textbox (也可以動態產生),使用同一個規則。 一般來說jquery validator只會驗證一個元素(假設你有多個name故意一樣,也只有一個會被驗證)



星期五, 8月 15, 2014

[AngularJS] 自訂directive控制圖片找不到



app.directive('errSrc', function() {
  return {
    link: function(scope, element, attrs) {

      scope.$watch(function() {
          return attrs['ngSrc'];
        }, function (value) {
          if (!value) {
            element.attr('src', attrs.errSrc);

      element.bind('error', function() {
        element.attr('src', attrs.errSrc);

星期一, 8月 11, 2014

[NetBeans] NetBeans安裝不同的佈景主題

Themes are contained in a .zip archive.
  1. Open the Options window: Tools -> Options (see picture 1)
  2. Press the Import button (see picture 1)
  3. Press the Browse button and select the theme file (a .zip archive).
  4. Tick the checkbox to select all settings (just Fonts & Colors will be fine as well, those are the themes) (see picture 2)
  5. Press OK and accept the confirmation dialog
  6. After restarting, go to Options again and select the theme at Fonts & ColorsProfile (see picture 1)

Options dialog

[Angular] MVC MVVM MVP 說文解字

常見的 MVC MVVM MVP 框架說文解字

Igor Minar

公開分享 - 2012年7月19日

MVC vs MVVM vs MVP. What a controversial topic that many developers can spend hours and hours debating and arguing about.

For several years +AngularJS was closer to MVC (or rather one of its client-side variants), but over time and thanks to many refactorings and api improvements, it'snow closer to MVVM – the $scope object could be considered the ViewModel that is being decorated by a function that we call a Controller.

Being able to categorize a framework and put it into one of the MV* buckets has some advantages. It can help developers get more comfortable with its apis by making it easier to create a mental model that represents the application that is being built with the framework. It can also help to establish terminology that is used by developers.

Having said, I'd rather see developers build kick-ass apps that are well-designed and follow separation of concerns, than see them waste time arguing about MV* nonsense. And for this reason, I hereby declare AngularJS to be MVW framework - Model-View-Whatever. Where Whatever stands for "whatever works for you".

Angular gives you a lot of flexibility to nicely separate presentation logic from business logic and presentation state. Please use it fuel your productivity and application maintainability rather than heated discussions about things that at the end of the day don't matter that much.


星期日, 8月 10, 2014

[AngularJS] IE 相容性

如果讓Angular 支援IE8要注意的項目,要注意的事項


星期五, 8月 08, 2014

[AngularJS] angular 執行順序

這篇文章回應了angular app執行順序:D 附執行範例。


Here's the calling order:
  1. app.config()
  2. app.run()
  3. directive's compile functions (if they are found in the dom)
  4. app.controller()
  5. directive's link functions (again if found)
Here's a simple demo where you can watch each execute (and experiment if you'd like).
Run blocks - get executed after the injector is created and are used to kickstart the application. Only instances and constants can be injected into run blocks. This is to prevent further system configuration during application run time.
Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests.
One place you see run blocks used is for authentication
<div ng-app="myApp" ng-controller="myCtrl">
    <div test1 test2> </div>
var myApp = angular.module('myApp', []);
myApp.factory('aProvider', function() {
myApp.directive("test1", function() {
    console.log("directive setup");
    return {
        compile: function() {console.log("directive compile");}
myApp.directive("test2", function() {
    return {
        link: function() {console.log("directive link");}
myApp.run(function() {
    console.log("app run");
myApp.config( function() {
    console.log("app config");
myApp.controller('myCtrl', function($scope) {
    console.log("app controller");


Related Posts with Thumbnails