springboot-angular2-tutorial / angular2-app Goto Github PK
View Code? Open in Web Editor NEWThis repository is an example application for angular2 tutorial
License: MIT License
This repository is an example application for angular2 tutorial
License: MIT License
hello,
I would like to ask a question , if i build a spring-boot angular2 in docker .
I can set the host in spring-boot server , as "localhost /192.168.1.110",
How set it in angular2 , that can be easily tested locally or 192.168.1.110 env?
Currently, scss files are generated under src directly. It does not harm anything, but not so good.
Waiting for angular/angular#13294
Once go to https://micropost.hana053.com/ and click Help on navigation. It is OK. But if I directly access help page, the content can not be shown.
It looks that HelpComponent#ngOnInit is called.
Now, it's always back to first page. But it's expected to be back to page 2.
Hi,akirasosa
I have build a angular2-app and spring boot app, refer to your work.
now , I find angular2-cli is concise maybe, will you plan to try?
I want to try ,but do not know how to set the "outDir","Proxy To Backend"
e.g
{
"/api": {
"target": "http://localhost:8080",
"secure": false
}
}
and in spring boot , how to set index.html.
<body>
<mpt-app />
<script th:src="|//${assetHost}/${manifest.get('polyfills.js')}|"></script>
<script th:src="|//${assetHost}/${manifest.get('vendor.js')}|"></script>
<script th:src="|//${assetHost}/${manifest.get('main.js')}|"></script>
The frontend does not work in IE11 (only shows blank page). Any idea how to fix that? Thanks!
npm install doesn't work on a windows and also not on linux. It seems that fsevents is a dependency of webpack and fsevents only fits to Mac architecture.
this is a part of npm install --verbose
...
npm info lifecycle [email protected]~prepublish: [email protected]
[email protected] c:\dev_playground\angular2springboot\angular2-app
`-- [email protected] extraneous
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fseve
[email protected]
npm verb exit [ 0, true ]
npm info ok
Is ist possible to correct that so that the app also runs on windows or linux?
HI,
I try use this to apply websocket, but not work , can help me?
front -
import * as SockJS from 'sockjs-client';
public stompClient: any;
const Stomp = require('stompjs/lib/stomp').Stomp;
ngOnInit() {
this.connect();
}
connect() {
const socket=new SockJS(sockUrl);
this.stompClient=Stomp.over(socket);
this.stompClient.connect({},e=>{
this.connected=true;
console.log('Connected: ' + e);
this.stompClient.subscribe(this.subUrl,v=>{
console.log(JSON.parse(v.body).content);
this.mm.next(JSON.parse(v.body).content);
})
})
}
public send() {
this.stompClient.send(this.sendUrl,{},JSON.stringify({ 'name': value }));
}
and back java --
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketBrokerConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
// client 链接的 socket url
registry.addEndpoint("/socket")
.setAllowedOrigins("http://localhost:8080")
.withSockJS()
;
}
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/topic");
config.setApplicationDestinationPrefixes("/app");
}
}
rest:--
@MessageMapping("/hello")
@SendTo("/topic/greetings")
public Greeting g(HelloMessage message) throws InterruptedException {
log.info("stock web is start ! from is : " + message);
TimeUnit.SECONDS.sleep(1); // simulated delay
return new Greeting("Hello, " + message.getName() + "!");
}
the socket can opening .
but when send message from front , back code --
" log.info("stock web is start ! from is : " + message);" is not working ..
Is the " front 3000 port redirect to back 8080 port issue"?
This is just a remind for myself.
Here is a quote from CHANGELOG.
http: return Response headers (4332ccf), closes #5237
This workaround won't be necessary anymore.
https://github.com/springboot-angular2-tutorial/angular2-app/blob/master/src/app/http/xhr_backend.ts#L96
previously http would only error on network errors to match the fetch specification. Now status codes less than 200 and greater than 299 will cause Http's Observable to error.
Handling http error might be changed.
-rw-r--r-- 1 akira staff 850673 Oct 9 00:55 main.2761a809ca3f1249d16d.js
-rw-r--r-- 1 akira staff 91243 Oct 9 00:55 polyfills.a1140c36d616d48b4a02.js
-rw-r--r-- 1 akira staff 260722 Oct 9 00:55 vendor.bb4da91788461244986c.js
Currently, main includes @angular
.
Sorry for dummy question, but where is entry point ?
Where <app></app>
is located to run app ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.