• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript main.angularApp类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中app/main.angularApp的典型用法代码示例。如果您正苦于以下问题:TypeScript angularApp类的具体用法?TypeScript angularApp怎么用?TypeScript angularApp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了angularApp类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: _configureFilterCache

    private _configureFilterCache(): void {

        // el nombre de la clave de cache sera: 'nombreclase.filter', de este modo cada lista podra reusar su cache de filtros
        let cacheFilterKey: string = (this.constructor as any).name + ".filter";

        this._listStateProperties = angularApp.getCacheFactory(enumCacheFactoryKeys.CACHE_FILTER_ID).get(cacheFilterKey) as IListStateProperties<TFilter>;
        if (undefined == this._listStateProperties) {
            this._resetListStateProperties();
            angularApp.getCacheFactory(enumCacheFactoryKeys.CACHE_FILTER_ID).put(cacheFilterKey, this._listStateProperties);
        }
    }
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:11,代码来源:baseListController.ts


示例2: constructor

    constructor($scope: ng.IScope, usersService: IUsersService) {
        this._scope = $scope;
        this._usersService = usersService;

        this._users = [];

        this._init();
    }

    /** Users */
    public get Users(): IUserModel[] {
        return this._users;
    }

    private _init(): void {

        this._usersService.getUsers().then((resultCallback: IUserModel[]) => {
            this._users = resultCallback;
        });
    }

}

// establecer variables a inyectar en el controlador
// NOTA: (Deben seguir el mismo orden que el constructor del controlador)
UsersController.$inject = ["$scope", "usersService"];

// registrar el controlador en la aplicacion
angularApp.registerController("usersController", UsersController);
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:29,代码来源:users.controller.ts


示例3: _closeAlert

            mainContent.insertBefore(alertsContainer, mainContent.firstChild);

            // crear la alerta en su contenedor y cerrarla en el tiempo especificado
            let uibAlert: HTMLElement = document.createElement("div");
            uibAlert.setAttribute("uib-alert", "");
            uibAlert.setAttribute("data-ng-repeat", `alert in ${ROOT_SCOPE_ALERT_PROPERTY}`);
            uibAlert.setAttribute("data-ng-class", "'alert-' + (alert.typeuib || 'warning')");
            uibAlert.setAttribute("close", `${ROOT_SCOPE_CLOSE_ALERT_FN}(alert.id)`);
            uibAlert.innerHTML = "{{ alert.html }}";

            alertsContainer.appendChild(uibAlert);

            this._compile(alertsContainer)(this._rootScope);
        }

    }

    private _closeAlert(id: number): void {
        // NOTA: angular ui entra en esta funcion desde otro ambito, y no puede usarse una propiedad de la IClientAlertsService
        let item: any = Helpers.findArrayItemFromPropertyValue(angularApp.rootScopeService[ROOT_SCOPE_ALERT_PROPERTY], "id", id);
        let index: number = angularApp.rootScopeService[ROOT_SCOPE_ALERT_PROPERTY].indexOf(item);
        angularApp.rootScopeService[ROOT_SCOPE_ALERT_PROPERTY].splice(index, 1);
    }


}

// NOTA: (Deben seguir el mismo orden que el constructor del viewmodel)
UiToastService.$inject = ["$rootScope", "$compile"];
angularApp.registerService("uiToastService", UiToastService);
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:30,代码来源:toast.service.ts


示例4: _readConnectedUserInfo

            this._readConnectedUserInfo();
        }

        this._rootScope.$on(EVT_LOGIN, () => {
            this._readConnectedUserInfo();
        });

        this._rootScope.$on(EVT_LOGOUT, () => {
            this._connectedUser = undefined;
        });
    }

    private _readConnectedUserInfo(): ng.IPromise<void> {

        let url: string = `${BASE_URL}content/mocks/userInfo.json`;

        return this.httpGet<IUserModel>(url)
            .then((resultCallback: ng.IHttpPromiseCallbackArg<IUserModel>): void => {
                this._connectedUser = resultCallback.data;
            })
            .catch(() => {
                this._connectedUser = undefined;
            })
            .finally(() => { this._rootScope.$emit(EVT_USERINFO_LOADED); });
    }
}

// NOTA: (Deben seguir el mismo orden que el constructor del viewmodel)
UsersService.$inject = ["$rootScope", "$http", "$q", "authenticationService"];
angularApp.registerService("usersService", UsersService);
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:30,代码来源:users.service.ts


示例5: loaderComponent

 *   <loader></loader>
 * @endcode
 */
let loaderComponent: Function = (): ng.IComponentOptions => {
    // crear y retornar el objeto con el componente
    return {
        controller: "loaderComponentController",
        template: `
        <div class="black-bg loader">
            <i class="fa fa-circle-o-notch fa-spin fa-fw"></i>
        </div>`
    };
};

// registrar la directiva en la aplicacion
angularApp.registerComponent("loader", loaderComponent());


/******************************************
 * Controlador del componente
 */

/** @Brief Controlador para el componente "loaderComponent" */
class LoaderComponentController {

    // Servicios
    private _rootScope: ng.IRootScopeService;
    private _scope: ng.IScope;
    private _element: JQuery;

开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:29,代码来源:loader.component.ts


示例6:

/******************************************
 * Componente
 */

/** @Brief componente con un menu lateral para la pagina principal de la aplicacion
 * @code
 * <main-sidebar></main-sidebar>
 * @endcode
 */
let mainSidebarComponent: ng.IComponentOptions = {
    controller: "mainSidebarComponentController",
    templateUrl: "app/components/main/mainSidebar.component.html"
};

// registrar el componente en la aplicacion
angularApp.registerComponent("mainSidebar", mainSidebarComponent);



/******************************************
 * Controlador
 */


/** @Brief Controlador para el componente 'mainSidebarComponent' */
class MainSidebarComponentController {

    // Servicios
    private _scope: ng.IScope;
    private _attrs: any;
    private _element: JQuery;
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:31,代码来源:mainSidebar.component.ts


示例7: logOut

            };

            this._localStorageService.set(LOCAL_STORAGE_AUTH_KEY, loginResponse);

            this._rootScope.$emit(EVT_LOGIN);

            return loginResponse;
        })
        .catch((reason: any) => {
            angularApp.logService.error("Error: auth.service - login: " + angular.toJson(reason.data));
            this.logOut();
            return this._q.reject(reason);
        });

    }

    public logOut(): void {
        this._localStorageService.remove(LOCAL_STORAGE_AUTH_KEY);

        this._rootScope.$emit(EVT_LOGOUT);
        angularApp.logService.debug("authentication.service - logOut");
    }


};


// NOTA: (Deben seguir el mismo orden que el constructor del viewmodel)
AuthenticationService.$inject = ["$rootScope", "$http", "$q", "localStorageService"];
angularApp.registerService("authenticationService", AuthenticationService);
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:30,代码来源:authentication.service.ts


示例8: constructor

import { angularApp } from "app/main";

class HomeController {

    // services
    private _scope: ng.IScope;

    /** Constructor por defecto de la clase */
    constructor($scope: ng.IScope) {
        this._scope = $scope;
    }
}

// establecer variables a inyectar en el controlador
// NOTA: (Deben seguir el mismo orden que el constructor del controlador)
HomeController.$inject = ["$scope"];

// registrar el controlador en la aplicacion
angularApp.registerController("homeController", HomeController);
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:19,代码来源:home.controller.ts



注:本文中的app/main.angularApp类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript main.angularApp.logService类代码示例发布时间:2022-05-25
下一篇:
TypeScript profile.service.ProfileService类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap