2017-09-07 6 views
-2

は角型モジュールです。e.put( "app/main/test1/yr/btg/limtyst-view.html"のようなステートメントがあります。 .soの上のいずれかは、あなた、これはSampleControllerと呼ばれるコントローラを登録し、機能eのロジックを使用するために、角告げるこのください角型Jsモジュールとコントローラ - 以下のコードを説明することができます。

angular.module("fuse").run(["$templateCache", function(e) { 
    e.put("app/main/test1/yr/btg/limtyst-view.html", '<div class="todo-items"><div class="todo-item" md-ink-ripple="" layout="row" layout-align="start center" ng-repeat="activity in vm.activities | orderBy:\'-completed\'" ng-click="vm.openResourceDialog($event, activity)" ng-class="{ \'completed\': activity.completed}"><div class="handle" ng-click="vm.preventDefault($event)"><md-icon md-font-icon="icon-drag-vertical" class="icon"></md-icon></div><div layout="row" layout-align="start center" flex=""><div class="info" flex=""><div class="title">{{activity.activity_label}}</div><div class="notes"></div><div class="tags" layout="row" layout-align="start center" ng-if="activity.company_name"><div class="tag" layout="row" layout-align="start center"><div class="tag-color" ng-style="{\'background-color\': \'#388E3C\'}"></div><div class="tag-label">{{activity.company_name}}</div></div></div></div><div class="buttons" layout="row" layout-align="start center"><md-icon md-font-icon="icon-alert-circle" class="is-important red-600-fg" ng-if="activity.important"></md-icon><md-icon md-font-icon="icon-star" class="is-starred amber-600-fg" ng-if="vm.activity.company_id"></md-icon><md-menu><md-button class="md-icon-button" aria-label="More" translate="" translate-attr-aria-label="TODO.MORE"><md-icon md-font-icon="icon-dots-vertical" ng-click="$mdOpenMenu($event)"></md-icon></md-button><md-menu-content width="3"><md-menu-item><md-button ng-click="activity.completed = !activity.completed" aria-label="Toggle done" translate-attr-aria-label="TODO.TOGGLE_DONE"><md-icon ng-class="activity.completed === false ? \'grey-fg\' : \'blue-fg\'" md-font-icon="icon-checkbox-marked-circle" class="s18"></md-icon><span ng-show="!activity.completed" translate="ACTIVITY.MARK_AS_DONE">Mark as done</span> <span ng-show="activity.completed" translate="ACTIVITY.MARK_AS_UNDONE">Mark as undone</span></md-button></md-menu-item></md-menu-content></md-menu></div></div></div></div>'), e.put("app/core/directives/ms-card/templates/template-10/template-10.html", '<div class="template-10 p-16"><div class="pb-16" layout="row" layout-align="space-between center"><div class="info"><div class="title secondary-text" ng-if="card.title">{{card.title}}</div><div class="subtitle h2" ng-if="card.subtitle">{{card.subtitle}}</div></div><div class="media ml-16"><img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image"></div></div><div class="text">{{card.text}}</div></div>'), e.put("app/core/directives/ms-card/templates/template-1/template-1.html", '<div class="template-1"><div class="media"><img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image"></div><div class="content pv-24 ph-16"><div class="title h1" ng-if="card.title">{{card.title}}</div><div class="subtitle secondary-text" ng-if="card.subtitle">{{card.subtitle}}</div><div class="text pt-16" ng-if="card.text">{{card.text}}</div></div></div>'), e.put("app/core/directives/ms-card/templates/template-2/template-2.html", '<div class="template-2"><div class="header p-16" layout="row" layout-align="start center"><div ng-if="card.avatar"><img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}"></div><div class="info"><div class="title" ng-if="card.title">{{card.title}}</div><div class="subtitle secondary-text" ng-if="card.subtitle">{{card.subtitle}}</div></div></div><div class="media"><img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image"></div><div class="text p-16" ng-if="card.text">{{card.text}}</div></div>'), e.put("app/core/directives/ms-card/templates/template-3/template-3.html", '<div class="template-3 p-16 teal-bg white-fg" layout="row" layout-align="space-between"><div layout="column" layout-align="space-between"><div class="info"><div class="title h1" ng-if="card.title">{{card.title}}</div><div class="subtitle h3 secondary-text" ng-if="card.subtitle">{{card.subtitle}}</div></div><div class="cta"><md-button class="m-0">{{card.cta}}</md-button></div></div><div class="media pl-16"><img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image"></div></div>'), e.put("app/core/directives/ms-card/templates/template-4/template-4.html", '<div class="template-4"><div class="info white-fg ph-16 pv-24"><div class="title h1" ng-if="card.title">{{card.title}}</div><div class="text" ng-if="card.text">{{card.text}}</div></div><div class="media"><img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image"></div></div>'), e.put("app/core/directives/ms-card/templates/template-5/template-5.html", '<div class="template-5 p-16" layout="row" layout-align="space-between start"><div class="info"><div class="title secondary-text" ng-if="card.title">{{card.title}}</div><div class="event h2" ng-if="card.event">{{card.event}}</div></div><div class="media ml-16"><img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image"></div></div>'), e.put("app/core/directives/ms-card/templates/template-6/template-6.html", '<div class="template-6"><div class="content pv-24 ph-16"><div class="subtitle secondary-text" ng-if="card.subtitle">{{card.subtitle}}</div><div class="title h2" ng-if="card.title">{{card.title}}</div><div class="text pt-8" ng-if="card.text">{{card.text}}</div></div></div>'), e.put("app/core/directives/ms-card/templates/template-7/template-7.html", '<div class="template-7" layout="row" layout-align="space-between"><div class="info" layout="column" layout-align="space-between" layout-fill="" flex=""><div class="p-16"><div class="title h1" ng-if="card.title">{{card.title}}</div><div class="subtitle h4 secondary-text" ng-if="card.subtitle">{{card.subtitle}}</div><div class="text h4 pt-8" ng-if="card.text">{{card.text}}</div></div><div><md-divider></md-divider><div class="p-8" layout="row"><md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon><md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon><md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon><md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon><md-icon md-font-icon="icon-star-outline" class="mh-5"></md-icon></div></div></div><div class="media"><img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image"></div></div>'), e.put("app/core/directives/ms-card/templates/template-8/template-8.html", '<div class="template-8"><div class="media"><img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image"></div><div class="content pv-24 ph-16"><div class="title h1" ng-if="card.title">{{card.title}}</div><div class="subtitle secondary-text" ng-if="card.subtitle">{{card.subtitle}}</div><div class="buttons pt-16"><md-button class="m-0">{{card.button1}}</md-button><md-button class="m-0 md-accent">{{card.button2}}</md-button></div><div class="text pt-16" ng-if="card.text">{{card.text}}</div></div></div>'), e.put("app/core/directives/ms-card/templates/template-9/template-9.html", '<div class="template-9"><div class="header p-16" layout="row" layout-align="start center"><div ng-if="card.avatar"><img class="avatar mr-16" ng-src="{{card.avatar.src}}" alt="{{card.avatar.alt}}"></div><div class="info"><div class="title" ng-if="card.title">{{card.title}}</div><div class="subtitle secondary-text" ng-if="card.subtitle">{{card.subtitle}}</div></div></div><div class="text ph-16 pb-16" ng-if="card.text">{{card.text}}</div><div class="media"><img class="image" ng-src="{{card.media.image.src}}" alt="{{card.media.image.alt}}" ng-show="card.media.image"></div><div class="buttons m-8"><md-button class="md-icon-button mr-16" aria-label="Favorite"><md-icon md-font-icon="icon-heart-outline" class="s24"></md-icon></md-button><md-button class="md-icon-button" aria-label="Share"><md-icon md-font-icon="icon-share" class="s24"></md-icon></md-button></div></div>'), e.put("app/main/orders/order/sidenavs/main/main-sidenav.html", '<div class="header" layout="column" layout-align="space-between start"></div><md-content ms-scroll="" class="content" flex=""><div class="navigation-simple" layout="column"><md-button class="item" aria-label="inbox" ng-click="vm.changeTemplate(\'vendor\')"><div layout="row" layout-align="start center"><md-icon md-font-icon="icon-inbox" class="s16"></md-icon><span class="title">Assign Vendor</span></div></md-button><md-button class="item" aria-label="inbox" ng-click="vm.changeTemplate(\'addresses\')"><div layout="row" layout-align="start center"><md-icon md-font-icon="icon-inbox" class="s16"></md-icon><span class="title">Addresses</span></div></md-button></div></md-content>') 
}]); 

thnkx &よろしく

+0

e、tなどのパラメータは、eに割り当てられた配列にリストされています。$ inject – barbsan

答えて

0

angular.module("sample").controller("SampleController", e)

私を説明することができます宣言上記のared。この行で

e.$inject = ["fuseTheming", "AuthenticationService", "$rootScope", "$location", "$window"]

、あなたのコントローラ、eの中にあるものを5つのサービスを注入しています。ここで

function e(e, t, a, n, i)

、あなたのコントローラに注入5つのパラメータで、関数eを宣言しています。例えば、efuseThemingtAuthenticationServicea$rootScopeとなります。

+0

これはコントローラの登録に使用する正しい方法ですか? – Arryn

+0

1文字の変数名を除いて、はい。それはちょうど混乱につながり、私はそれに理由がないのです。 –

関連する問題