ASP.NET MVC,AngularJS,鲍尔和部署站点文件夹结构 [英] ASP.NET MVC, AngularJS, Bower and deploying site folder structure

查看:199
本文介绍了ASP.NET MVC,AngularJS,鲍尔和部署站点文件夹结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读了很多关于网站的文件夹结构的文章和问题(发展和放大器;部署),仍然有大约missunderstood以下问题

I've read a lot of articles and questions about site folder structure (develop & deploy) and still have missunderstood about questions below.

我标志着我当前文件夹结构:

I marked my current folder structure:


  • 橙色 - 看起来像 LIB 供应商文件夹,在这里我想存储独立的组件;

  • 蓝 - 文件夹包含我自己的,相对于目前的项目(应用程序)文件;

  • 绿 - 准备部署文件夹,它含有精缩与放; concated文件,它使用被列入的index.html。

  • Orange- looks like lib or vendor folder, where i'd like to store independent components;
  • Blue- folder contains my own, relative to current project (application) files;
  • Green- ready to deploy folder, that contains minified & concated files, which used to be included in index.html.

有几个问题我想找到一个答案:

There are a few questions i'd like to find an answer:


  • 是不是正确,最好的做法是部署到Web服务器仅 DIST 文件夹?

  • 我应该Concat的我的 bower_components &安培; 应用 JavaScript文件成单app.min.js文件?我应该乱用应用程序文件和奥伯订货独立的组件?

  • 我应该部署的的意见与模板文件夹如同 DIST /视图文件夹?

  • 是否正确惹所有图像(CSS图像,图像的应用程序,插件图像)为单一的 DIST /图片文件夹?

  • 是不是正确的存储的指令在模板中的的意见文件夹?

  • 有相对AngularJS不是客户端/应用/ JS /普通/ helpers.js 文件 - 我想不通的地方是,最明显的地方(也可能是原型,自定义函数或对象)

  • Is it correct, that the best practise is deploying to web server only dist folder?
  • Should i concat my bower_components & app javascript files into single app.min.js file? Should i mess independent components with application files and ober ordering?
  • Should i deploy views folder with templates as is into dist/views folder?
  • Is it correct to mess all images (css images, app images, plugin images) into single dist/images folder?
  • Is it correct to store directive templates in views folder?
  • There is not relative to AngularJS client/app/js/common/helpers.js file,- i can't figure out where is the most obvious place for that (it could be prototypes, custom functions or objects)

我会很高兴的任何帮助,TY。

I will be glad for any help, ty.

在这里输入的形象描述

推荐答案

下面是我的目录结构的角度网站我建立名为绑定在一起使用Browserify简单小组

Here is my directory structure for an angular site I'm building called Simple Team that is bound together using Browserify.

在这里输入的形象描述

这是我的文档根在那里我开始的框架,并提供公开的文件。我所有的JS和HTML必将汇集成 app.min.js

This is my document root where my framework starts and serves public files. All my JS and HTML is bound together into app.min.js.

在这里输入的形象描述

这是我建立我的指令与意见要求()'d。在

This is how I build my directives as modules with the views require()'d in.

在这里输入的形象描述

"use strict"

require('moment')
require('angular-ui-router')
require('angular-ui-sortable')
require('angular-gravatar')
require('angular-elastic')
require('angular-local-storage')
require('angular-moment')

require('./routes.js')
require('./modules/focusMe')
require('./modules/selectize')
require('./modules/tagData')
require('./modules/www')
require('./modules/uiSrefActiveIf')

angular
    .module('simple.team', [
        'ngFileUpload',
        'ui.router',
        'ui.sortable',
        'ui.gravatar',
        'ui.bootstrap',
        'selectize',
        'angularMoment',
        'angular-loading-bar',
        'ng-showdown',
        'LocalStorageModule',
        'monospaced.elastic',
        'textAngular',

        'simple.team.uiSrefActiveIf',
        'simple.team.routes',
        'simple.team.focusMe',
        'simple.team.ngBindHtmlUnsafe',
        'simple.team.bytes',
        'simple.team.strings',
        'simple.team.auth',
        'simple.team.tagData',
        'simple.team.userData',
        'simple.team.www'
    ])
    .config(function($urlRouterProvider, cfpLoadingBarProvider) {
        $urlRouterProvider.otherwise('/projects')
        cfpLoadingBarProvider.includeSpinner = false
    })
    .controller('AppCtrl', function($state, $http, $rootScope) {
        // Controller code
    })

路线和控制器

angular
    .module('simple.team.routes', [])
    .config(function($stateProvider) {
        $stateProvider
            .state('projects', {
                url: '/projects',
                template: require('./layouts/projects.html'),
                controller: ProjectsCtrl,
                controllerAs: 'ctrl'
            })
            .state('projects.card', {
                url: '/card/?cardId',
                template: require('./layouts/card.html'),
                controller: require('./controllers/card.ctrl.js'),
                controllerAs: 'ctrl'
            })

这篇关于ASP.NET MVC,AngularJS,鲍尔和部署站点文件夹结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆