How to activate Javascript(Angularjs) variable intellisense in html - html

I have a variable in js. I want to get it from html page by intellisense.
js Code :
var buyer ="Addidas"; in js file.
Now I want to get it in html body as intellisense.
{{buyer}}

try to read `Angular official document,

In your AngularJS controller:
$scope.buyer = "Adidas";
In your html:
{{buyer}}

WARNING: You won't just know Angular once you have intellisense enabled, you will actual have to spend some effort learning it!!!
To enable intellisense follow these steps:
1) Learn Angular by reading the documentation, blog posts, looking at angular projects in Github and following the questions in this site.
2) Learn about unit testing Angular and write some tests.
3) Practice what you learn by doing a few small sites with tests.
4) Once you have done the basics and put the effort in to learn the technology you will realise that just because you use angular it will not give you intellisense in notepad.
5) Once you have this epiphany you could start using an IDE like WebStorm which offers intellisense in most Angular apps if your project is structured correctly.
http://blog.jetbrains.com/webstorm/2014/03/angularjs-workflow-in-webstorm/

There is no intellisense for templates in Visual Studio. Yet. There is a lot of interest in this, especially within the context of Typescript and angular.
More interesting than just having intellisense for templates would be having a build fail if the variable isn't used isn't in the scope.
Unfortunately none of this exists yet.

Related

Autodesk forge - markup extension - create new EditMode tool

This is very similar to the question posted here but nothing useful was mentioned.
I'm trying to look for documentation on how to create a new EditMode tool for the markup extension. Documentation is very scarce and I can't find the source code for markup extensions. The only thing I can find is here.
I'm trying to decipher this file: https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/extensions/Markup/Markup.js but it has a lot of webpack references and is hard to read.
Has anyone managed to create a custom EditMode tool?
Edit
A member of my team has managed to find the source for the markup extension:
https://autodeskviewer.com/viewers/latest/docs/extensions_Markup_core_Markup.js.html
Unfortunately, implementing a custom markup type is not officially supported today. The documentation you found (https://autodeskviewer.com/viewers/latest/docs/tutorial-feature_markup.html#create-a-new-drawing-tool-a-new-editmode) is not production ready.
Edit:
While I still believe the markup code is not ready for custom markup implementation, here's a work-in-progress, custom markup tool drawing smiley faces:
https://github.com/petrbroz/forge-basic-app/blob/sample/custom-markup/public/smiley-markup.js
In the sample app it is activated with a button click:
https://github.com/petrbroz/forge-basic-app/blob/sample/custom-markup/public/main.js#L11-L20
And here it is in action: https://imgur.com/a/2SFrGIM

How make dynamic templateUrl in Angular

I have five variant my app and all of this have same functionality. But HTML templates are different.
Now i have five almost same *.ts files. For optimize, i have one of approach - make a logic to services, and after provide it to component, but i don't like it.
Can you help me solve this problem?
I don't want make component dynamically
I don't want use a lot of *ngIf in template (for each variant)
I wanna 1 *.component.ts and 5 *.<%variant%>.component.html and 5 *.<%variant%>.component.scss
(and i will choose one of <%variant%> in environment or like UseClass with Services)
I wanna IDE (Webstorm) support - binding, link html variables with *.ts
Yes, I know what people ask this question before and Templates in Angular are compiled into JavaScript by the AOT, and this impossible. But maybe somebody solve it from custom plugin, webpack config or something else

Extend Markdown Parser to render custom code blocks

I am building a static blog, which uses Marked to parse markdown. I want to be able to have code blocks with tabs.
I want to parse code that looks like this:
```JavaScript
var geolocation = require("nativescript-geolocation");
```
```TypeScript
import geolocation = require("nativescript-geolocation");
```
To something like this (from the angular2 docs), where the tab names would be JavaScript and TypeScript.
I am programming in JavaScript (nodeJs), so I could manually render this if required? What would a custom implementation of a code block tab look like?
I am not sure if there is a special name for these, as I can't really seem to find any examples or templates.
I think answer is: 'Marked' does not support custom tags. I've spend few hours trying to find some way to extend it and finally switched to showdown.
It appears to be really easy to implement one ( her is expandable section tag example ).
Extension 'showdownjs/prettify-extension' implements code highlighting using Google Prettify.

Dojo build requesting already inlined Dijit templates

I am a developer on a large Dojo project and I am having some issues with the Google Closure compiler.
We have around a hundred templates for Dijit widgets so the plan was to make the Closure compiler inline the HTML in the JavaScript file rather than require them AMD style.
To achieve this I changed the "mini" parameter in /profiles/app.profile.js from true to false.
When compiling, everything seems to work fine, even when running the app i have no issues but something strange happens.
Even if the HTML templates are correctly inlined in the dojo.js file, dojo is still making HTTP requests to the corresponding template file to the server !
By inspecting a "beautified" version of what the Closure Compiler produced I can observe that each HTML template is present in two different places :
1) Inlined in the JavaScript in the following format :
"url:path/to/my/template.html":"<p>Some more HTML</p>"
2) As a required pseudo-module in the AMD require :
dojo/text!./path/to/my/template.html
I searched the bug reports on their website in the BuildSystem category : BuildSystem but ultimately couldn't find any relevant help.
Is this me just wrongly using the Google Closure Compiler or is this a open / unreported bug ?
How can I fix this issue ?
Thanks a lot in advance !
If you are referring to an issue that only exists in 1.9.0, then it is https://bugs.dojotoolkit.org/ticket/17141.

is there any code editor plugin for converting jade to html?

I'm new to *jade* so it's difficult for me to design a web page by it. i need to test the code and see the result continuously.
i want to know is there any way to convert jade to html and viceversa in code editor?
is there any plugin? No matter what code editor but if there is sublime plugin it is better for me.
You could try creating a dedicated Node + Express app with a single view and paste in your jade and check it in a browser.
Jade Syntax Documentation with interactive samples:
http://naltatis.github.com/jade-syntax-docs/
There is a "Jade" package for Sublime Text 2 available using package control. When combined with a decent colour scheme, syntax errors are very obvious.
ST2 package control:
http://wbond.net/sublime_packages/package_control
The current "Jade" bundle / package:
https://github.com/davidrios/jade-tmbundle
Package control's known repositories:
https://github.com/wbond/package_control_channel/blob/master/repositories.json
Online html to jade converters:
http://html2jade.aaron-powell.com/
http://www.htmltojade.com/
jade itself transforms jade files to html automatically. But keep in mind that jade is a templating language with interpreted commands and thus is not a one to one conversion from jade to html.
BTW, there's a tool that do html to jade conversion available here : https://github.com/donpark/html2jade
Probably you can run them from SublimeText
Check prepros from alphapixels. It compiles jade, haml, sass / scss, less and coffee. It watches your file for changes and compiles on real-time, so you can use the code editor of your choice. It works fine for me.