小编Xin*_* Ma的帖子

将Angular2 TypeScript文件和JavaScript文件分隔到不同的文件夹中,可能是'dist'

我正在使用angular.io网站上的5分钟快速入门,其中包含如下文件结构:

angular2-quickstart
 app
   app.component.ts
   boot.ts
 index.html
 license.md
 package.json
 tsconfig.json
Run Code Online (Sandbox Code Playgroud)

tsconfig.json是这样的代码块:

{
  "compilerOptions": {
    "target": "ES5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules"
  ]
} 
Run Code Online (Sandbox Code Playgroud)

还有package.json:

{
  "name": "angular2-quickstart",
  "version": "1.0.0",
  "scripts": {
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "lite": "lite-server",
    "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
  },
  "license": "ISC",
  "dependencies": {
    "angular2": "2.0.0-beta.0",
    "systemjs": "0.19.6",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.0",
    "zone.js": "0.5.10" …
Run Code Online (Sandbox Code Playgroud)

javascript json angular

82
推荐指数
7
解决办法
4万
查看次数

什么是数据目标和数据幻灯片属性?

我正在使用bootstrap,(好吧,我是新手),我发现这两个属性,有人可以解释一下吗?

html css frontend twitter-bootstrap

22
推荐指数
3
解决办法
5万
查看次数

ng2-bootstrap,调用来自父compnt的子组件中定义的Modal

我正在使用ng2-bootstrap作为模态的东西.

我试图将我的模态和我的其他组件分开.所以我有以下文件:

addPlaylist.modal.ts

import {Component} from '@angular/core';
import {CORE_DIRECTIVES} from '@angular/common';


import {MODAL_DIRECTVES, BS_VIEW_PROVIDERS} from 'ng2-bootstrap/ng2-bootstrap';

@Component({
  selector: 'addplaylist-modal',
  directives: [MODAL_DIRECTVES, CORE_DIRECTIVES],
  viewProviders: [BS_VIEW_PROVIDERS],
  templateUrl: 'app/channel/modals/addPlaylistModal.html'
})

export class AddPlaylistModalComponent {
  constructor() {
    console.log(this);
  }
}
Run Code Online (Sandbox Code Playgroud)

addPlaylistModal.html

<div bsModal #lgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" (click)="lgModal.hide()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">Large modal</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
    </div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

在它的父组件的html我有这样的代码片段:

  <a (click)="lgModal.show()"><span class="bigplus pull-right"></span></a>
   //some …
Run Code Online (Sandbox Code Playgroud)

javascript typescript bootstrap-modal ng2-bootstrap angular

3
推荐指数
1
解决办法
8989
查看次数

移动到我的localhost后无法登录Magento管理页面

我只是将我的Magento商店移动到我的localhost环境进行测试使用,我也使用Git来维护代码,但是在我将所有文件移动到我的本地环境后,我无法登录我的管理页面,但我仍然可以看到我的前端页面和git,数据库,似乎运作良好.

当我输入错误的管理员/密码到我的管理页面时,它仍然给我"密码无效".但是当我输入正确的页面时,它只是刷新页面并保持在登录页面,没有任何反应.

有没有人以前遇到过这个问题?有什么想法吗?

提前致谢!

admin backend magento

2
推荐指数
1
解决办法
2万
查看次数

使用BST搜索多个字段

假设我们需要创建一个地址簿,该地址簿可以在多个字段上提供具有大量记录的搜索功能.结构非常简单 - 姓名,电话号码和城市名称.

我可以输入"以罗恩开头......"或"从202开始..."或"从阿灵开始......"

然后它会给我预期的结果.

我想到的第一个解决方案是,创建三个BST,一个基于电话号码,一个基于名称,第三个基于城市.

现在我在想,有没有办法创建一个BST(或任何其他方法),但仍然使搜索工作,而不是每次都排序?

提前致谢.

algorithm binary-search-tree data-structures

2
推荐指数
1
解决办法
720
查看次数

require()实际返回什么,文件或函数

例如,我有profile.js

var EventEmitter = require("events").EventEmitter;
var https = require("https");
var http = require("http");
var util = require("util");

    function Profile(username) {
     // function code here
    }

    util.inherits( Profile, EventEmitter );

    module.exports = Profile;
Run Code Online (Sandbox Code Playgroud)

在我的app.js中,我有

var Profile = require("./profile.js");


var studentProfile = new Profile("chalkers");

/**
* When the JSON body is fully recieved the 
* the "end" event is triggered and the full body
* is given to the handler or callback
**/
studentProfile.on("end", console.dir);

/**
* If a parsing, network or …
Run Code Online (Sandbox Code Playgroud)

javascript node.js

2
推荐指数
1
解决办法
4757
查看次数

leetcode 如何做到这一点:将用户的输入字符串读取为多个 JavaScript 函数,并使用用户的输入参数运行主函数

我正在尝试复制 leetcode 所做的事情,作为我的 React 学习项目。以下是我当前的用户界面设置。

我使用 AceEditor 作为文本编辑器,现在我可以在更改时从编辑器中读取值。

containsDuplicate我想在单击按钮时执行该功能Run code

我现在拥有的是一个字符串,codeValue以字符串格式表示用户的输入,以及testCase字符串格式的函数参数,

  // the codeValue is the complete text in the Ace Editor are
  const [codeValue, setCodeValue] = useState('');

  // The testCase is [1,2,3,1] which reads from the TestCase section
  const [testCase, setTextCaseValue] = useState('');

  const submitHandler = (inputParams) => {
    console.log(codeValue); 
  };
Run Code Online (Sandbox Code Playgroud)

我应该怎么做才能containsDuplicate使用 params运行该函数testCase?假设函数名称始终为containsDuplicate?

Eval() 会将字符串作为 JS 函数运行,但我需要的是,当字符串只是函数声明,并且有多个函数声明时,我需要从字符串中找到正确的函数,并使用给定的输入运行该函数。

假设输入字符串是

functionA() {
  functionB();
}

functionB() {
}
Run Code Online (Sandbox Code Playgroud)

我需要读取该字符串并运行 …

javascript frontend ecmascript-6 reactjs

2
推荐指数
1
解决办法
603
查看次数

当网格类适用于具有较小断点大小的设备时会发生什么

网格类适用于屏幕宽度大于或等于断点大小的设备,并覆盖针对较小设备的网格类.因此,将任何.col-md-类应用于元素不仅会影响其在中型设备上的样式,而且如果不存在.col-lg-类,也会影响大型设备.

现在,如果我们使用

 <div class="col-lg-4">div 1</div>
 <div class="col-lg-4">div 1</div>
 <div class="col-lg-4">div 1</div>
Run Code Online (Sandbox Code Playgroud)

它将在一行上布置为三列,当我们缩小屏幕尺寸时,它将分成三个垂直块.

所以我的问题是:引导程序是否做了一些事情来实现这一点,或者只是保持原样?

我们应用网格类时有什么好建议吗?由于col-xs-*也可以应用于大屏幕.那么在真正的电梯真实项目中,你做了什么?

谢谢.

css html5 responsive-design twitter-bootstrap twitter-bootstrap-3

1
推荐指数
1
解决办法
411
查看次数

我无法点击我网站上的超链接

当我设计网站时,我尝试使用href ="http://www.google.com"

但是我发现单击超链接时我无法访问Google.

请在这里查看网站

但是,如果我在源代码上单击它,它就可以工作.

有人有解决方案吗?

谢谢!

好的,转到http://abi.maxinrui.com/ 然后点击"点击我"它应该链接到谷歌,但它不是,当你点击源代码中的那个,你可以.

另外,我无法在单选按钮之间切换,请查看http://abi.maxinrui.com/#slide-5

html javascript jquery twitter-bootstrap

0
推荐指数
1
解决办法
153
查看次数