使用localhost中的服务器运行文件的基本区别是什么,并打开一个文件,例如file:///Users/$user_name/$your_directory/index.html,假设没有使用后端,它只是前端并包含html/css/js
这又如何影响与其他服务器的交互,即.ajax请求?
如果这个问题过于宽泛,我很抱歉,但我没有找到这些基本问题的可靠答案.
我正在使用Polymer并手动重新加载文件中的更改。因此,我尝试使用using browser-sync并且也browser-sync with gulp无法成功。
我尝试了以下两种方法:
1)package.json中的npm脚本
"scripts": {
"dev": "polymer serve | npm run watch",
"watch": "browser-sync start --proxy localhost:8080 --files 'src/*.html, src/*.js, images/*' "
},
Run Code Online (Sandbox Code Playgroud)
使用运行它npm run dev,它运行了但无法检测到文件中的更改。
2)在浏览器同步中使用gulp
var gulp = require('gulp');
var bs = require('browser-sync').create();
gulp.task('browser-sync', function() {
bs.init({
port : 5000,
proxy: {
target : "localhost:8080"
}
});
});
gulp.task('watch', ['browser-sync'], function () {
gulp.watch("*.html").on('change', bs.reload);
});
Run Code Online (Sandbox Code Playgroud)
它还运行,但无法检测*.html文件src夹中存在的文件更改。
谁能帮助我,为什么未检测到文件更改。
我尝试在应用程序中提供两个ng-app,当时我给了两个ng-app
<body>
<div ng-app="A">
<div ng-controller="AC">
</div>
</div>
<div ng-app="B">
<div ng-controller="BC">
</div>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
然后第二个ng-app不起作用.
但是当我将第一个ng-app ="A"的范围从div更改为body时,两者都可以正常工作
<body ng-app="A">
<div>
<div ng-controller="AC">
</div>
</div>
<div ng-app="B">
<div ng-controller="BC">
</div>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
任何人都可以让我知道为什么这种行为,因为我对角度很新.我想知道为什么它的工作,因为我没有在第二one.I称为angular.bootstrap试图寻找,但我并没有得到它是如何从DIV改变NG-应用程序的范围,以身体的时候工作.
找到相同的https://jsfiddle.net/maddyjolly2112/wyfd0djp/1/的小提琴,并介意将js复制到同一个.
PS - 如果你们不能回答这个问题,请不要无缘无故地投票
我将分钟转换为数天和数小时.当我使用以下代码时,它工作正常
declare @theMinutes int
Set @theMinutes = 1449
select cast(@theMinutes / 1440 as varchar)
+ ' Day(s) '+ cast((@theMinutes % 1440 / 60) as varchar)
+ ' Hour(s) '+ cast(@theMinutes % 60 as varchar)
+ ' Minute(s)' AS COLUMN_A
Run Code Online (Sandbox Code Playgroud)
并显示结果
1 Day(s) 0 Hour(s) 9 Minute(s)
Run Code Online (Sandbox Code Playgroud)
但是当我使用它来编写一个函数时,它只返回1,其余的东西都没有连接起来
Create function [dbo].[ConvertMinToDays]
(
@theMinutes int
)
RETURNS varchar
AS
BEGIN
Declare @convertedStr varchar(200)
SET @convertedStr = cast(@theMinutes / 1440 as varchar(10)) + ' Day(s) '
+ cast((@theMinutes % 1440 / 60) as …Run Code Online (Sandbox Code Playgroud) javascript ×2
angularjs ×1
browser-sync ×1
css ×1
gulp ×1
html ×1
localhost ×1
polymer ×1
polymer-1.0 ×1
server ×1
sql ×1
sql-server ×1