对于想了解angularjs–由Google索引的角度应用程序的读者,本文将提供新的信息,我们将详细介绍angularjs$apply,并且为您提供关于Angular6:使用Typescript调试库
对于想了解angularjs – 由Google索引的角度应用程序的读者,本文将提供新的信息,我们将详细介绍angularjs $apply,并且为您提供关于Angular 6:使用Typescript调试库,而“ ng服务”主要的角度应用程序、Angular2、AngularJS、React、vue.js过去一年的Google趋势分析、angularjs ngMeta标题描述不是由Google抓取、angularjs – Angular google maps – ng-repeat的有价值信息。
本文目录一览:- angularjs – 由Google索引的角度应用程序(angularjs $apply)
- Angular 6:使用Typescript调试库,而“ ng服务”主要的角度应用程序
- Angular2、AngularJS、React、vue.js过去一年的Google趋势分析
- angularjs ngMeta标题描述不是由Google抓取
- angularjs – Angular google maps – ng-repeat
angularjs – 由Google索引的角度应用程序(angularjs $apply)
使用prerender与Apache:
我已尝试使用以下步骤:
在角度:
$locationProvider.html5Mode(true);
在HTML中,添加此元标题:
<head> <Meta name="fragment" content="!"> </head>
配置Apache:
RewriteEngine On # If requested resource exists as a file or directory # (REQUEST_FILENAME is only relative in virtualhost context,so not usable) RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d # Go to it as is RewriteRule ^ - [L] # If non existent # If path ends with / and is not just a single /,redirect to without the trailing / RewriteCond %{REQUEST_URI} ^.*/$ RewriteCond %{REQUEST_URI} !^/$ RewriteRule ^(.*)/$$1 [R,QSA,L] # Handle Prerender.io RequestHeader set X-Prerender-Token "YOUR_TOKEN" RewriteCond %{HTTP_USER_AGENT} baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest [NC,OR] RewriteCond %{QUERY_STRING} _escaped_fragment_ # Proxy the request RewriteRule ^(.*)$http://service.prerender.io/http://%{HTTP_HOST}$1 [P,L] # If non existent # Accept everything on index.html RewriteRule ^ /index.html
这完全没有办法:Google无法读取我的子页面.
使用Node / Phantomjs来渲染页面
var express = require('express'); var app = module.exports = express(); var phantom = require('node-phantom'); app.use('/',function (req,res) { if (typeof(req.query._escaped_fragment_) !== "undefined") { phantom.create(function (err,ph) { return ph.createPage(function (err,page) { return page.open("https://system.dk/#!" + req.query._esca$ return page.evaluate((function () { return document.getElementsByTagName('html')[0].innerHT$ }),function (err,result) { res.send(result); return ph.exit(); }); }); }); }); } else res.render('index'); }); app.listen(3500); console.log('Magic happens on port ' + 3500);
在这里,我创建了这个站点,然后在我的Apache配置中添加了一个代理,以便所有请求都指向我的域端口3500.
这没有工作,因为它不能渲染索引,当我终于得到它发送JavaScript不会呈现的HTML页面.
以下自定义快照指南
然后我遵循这个指南:
http://www.yearofmoo.com/2012/11/angularjs-and-seo.html
然而,这需要我自己制作一些不是我正在寻找的东西,并且烦人的维护.加上make-snapshot在我的服务器上不起作用.
Google解析我的angularJS网站很好. https://www.google.nl/search?q=site%3Atest.coachgezocht.nu
使用$locationProvider.html5Mode(true);和:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index RewriteRule (.*) index.html [L]
Angular 6:使用Typescript调试库,而“ ng服务”主要的角度应用程序
如何解决Angular 6:使用Typescript调试库,而“ ng服务”主要的角度应用程序?
现在,我正在调试库,使其成为fems5文件夹中JavaScript中的单个大文件。
我有库源代码,并且在fems2文件夹中有.js.map,但是我不知道如何将它们链接到源代码并调试查看Typescript。
我尝试过:
- npm链接
- angular.json中设置的组合会构建并像“ vendorSourceMap”,“ sourceMap”,“ preserveSymlinks”一样使用
- tsconfig.json选项,例如“ sourceRoot”,“ mapRoot”,“路径”
但是我找不到而且也找不到任何仅涉及版本6的文档,以了解我是否正确使用它们。
有可能吗?有npm链接还是没有它?通过改变一些路径?将源复制到某个地方?
图书馆:
应用程序:
谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
Angular2、AngularJS、React、vue.js过去一年的Google趋势分析
Angular2、AngularJS、React、vue.js过去一年的Google、百度趋势分析
最近在学angular,但是在国内的话似乎是vuejs比较火,百度指数只有国内数据分析,于是翻了下墙上谷歌趋势搜索了以下关键词,包括angualr、angular2、angularjs、react和vuejs:
下图是进行了过去一年全球的比较,这个结果是网页搜索的结果,对应颜色可以看到相应的折线图,angular整体很高,react第二,angularjs依旧占据很大份额,angular2比较平缓,vuejs的话是最少的。
限制到中国,结果发生了比较大的逆转,react远高于其余三者,并且呈上升趋势,angular整体平稳,但也许是angularjs热度降低而angular2上升,vuejs表现依旧最弱。
接下来是用了百度指数分析,时间设置错了,是过去的14个月里变化趋势,可以看到绿色线条是angular2,高到有些可怕。
还有其他的图表分析,仔细看的话会发现数据上其实是有交叉的,准确度不能细究,只是个大概的趋势结果。
angularjs ngMeta标题描述不是由Google抓取
<title ng-bind="ngMeta.title"></title> <Meta property="og:title" content="{{ngMeta.title}}" /> <Meta property="og:description" content="{{ngMeta.description}}" />
我的控制器代码是
app.controller('controller1',function($scope,$location,$http,$routeParams,ngMeta,$route){ $scope.$route = $route; ngMeta.setTitle('site title'); ngMeta.setTag('description','this is description'); ngMeta.setTag('keywords','tag1,tsg2,tag3'); });
页面加载后,一切正常,但Google正在显示{{ngMeta.description}} {{ngMeta.title}}
任何帮助来解决这个问题。
我建议最好的方法来处理这将是使用prerendering。
我这样说,因为如果您的单页面应用程序正在进行API调用,Google搜寻器不会等待ajax调用完成,所以在技术上它不会通过API调用读取任何内容。花了我几天时间,使用网站管理员。
所以,你可以使用phantomJS或prerender.io(在内部使用phantomjs)。那么这样做是什么,它解析你的html文件,并用静态内容替换Javascript的内容,从而为机器人提供正确的和完整的内容。
否则,如果页面第一次加载,您可以直接从后端提供页面,所以这也有帮助。
angularjs – Angular google maps – ng-repeat
angular-google-maps: Could not find a valid center property
下面是代码,storeOwners是从rest API检索的,store.center是一个返回的对象,如下所示:
center: "{"latitude":-33.87787,"longitude":18.49352}"
抱歉这个fomatting
总结
以上是小编为你收集整理的angularjs – Angular google maps – ng-repeat全部内容。
如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。
今天关于angularjs – 由Google索引的角度应用程序和angularjs $apply的讲解已经结束,谢谢您的阅读,如果想了解更多关于Angular 6:使用Typescript调试库,而“ ng服务”主要的角度应用程序、Angular2、AngularJS、React、vue.js过去一年的Google趋势分析、angularjs ngMeta标题描述不是由Google抓取、angularjs – Angular google maps – ng-repeat的相关知识,请在本站搜索。
本文标签: